
(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 16 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)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), (log(y) * (-1.0 + x))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 90.3%
+-commutative90.3%
fma-define90.3%
sub-neg90.3%
metadata-eval90.3%
sub-neg90.3%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(-
(+
(*
(* y (+ -1.0 (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5))))
(+ z -1.0))
(* (log y) (+ -1.0 x)))
t))
double code(double x, double y, double z, double t) {
return (((y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))) * (z + -1.0)) + (log(y) * (-1.0 + x))) - 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 * ((-1.0d0) + (y * ((y * ((y * (-0.25d0)) - 0.3333333333333333d0)) - 0.5d0)))) * (z + (-1.0d0))) + (log(y) * ((-1.0d0) + x))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))) * (z + -1.0)) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return (((y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))) * (z + -1.0)) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * Float64(Float64(y * -0.25) - 0.3333333333333333)) - 0.5)))) * Float64(z + -1.0)) + Float64(log(y) * Float64(-1.0 + x))) - t) end
function tmp = code(x, y, z, t) tmp = (((y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))) * (z + -1.0)) + (log(y) * (-1.0 + x))) - t; end
code[x_, y_, z_, t_] := N[(N[(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] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\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) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 90.3%
Taylor expanded in y around 0 99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -40000000.0) (not (<= (+ -1.0 x) -1.0))) (- (* (log y) (+ -1.0 x)) t) (- (- (* y (- 1.0 z)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -40000000.0) || !((-1.0 + x) <= -1.0)) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = ((y * (1.0 - z)) - 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 ((((-1.0d0) + x) <= (-40000000.0d0)) .or. (.not. (((-1.0d0) + x) <= (-1.0d0)))) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = ((y * (1.0d0 - z)) - log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -40000000.0) || !((-1.0 + x) <= -1.0)) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -40000000.0) or not ((-1.0 + x) <= -1.0): tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = ((y * (1.0 - z)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -40000000.0) || !(Float64(-1.0 + x) <= -1.0)) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -40000000.0) || ~(((-1.0 + x) <= -1.0))) tmp = (log(y) * (-1.0 + x)) - t; else tmp = ((y * (1.0 - z)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -40000000.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -40000000 \lor \neg \left(-1 + x \leq -1\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -4e7 or -1 < (-.f64 x #s(literal 1 binary64)) Initial program 94.2%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
mul-1-neg99.7%
fma-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 76.2%
associate-/l*76.1%
sub-neg76.1%
metadata-eval76.1%
+-commutative76.1%
associate-*r/76.1%
neg-mul-176.1%
Simplified76.1%
Taylor expanded in y around 0 94.1%
if -4e7 < (-.f64 x #s(literal 1 binary64)) < -1Initial program 84.3%
flip--84.3%
metadata-eval84.3%
metadata-eval84.3%
associate-*l/84.3%
metadata-eval84.3%
fma-neg84.3%
metadata-eval84.3%
+-commutative84.3%
Applied egg-rr84.3%
Taylor expanded in y around 0 98.8%
mul-1-neg98.8%
distribute-rgt-neg-in98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
distribute-neg-in98.8%
metadata-eval98.8%
unsub-neg98.8%
Simplified98.8%
Taylor expanded in x around 0 98.8%
+-commutative98.8%
mul-1-neg98.8%
sub-neg98.8%
Simplified98.8%
Final simplification95.9%
(FPCore (x y z t) :precision binary64 (- (+ (* (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5)))) (+ z -1.0)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return (((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.0)) + (log(y) * (-1.0 + x))) - 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 * ((-1.0d0) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0)))) * (z + (-1.0d0))) + (log(y) * ((-1.0d0) + x))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.0)) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return (((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.0)) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5)))) * Float64(z + -1.0)) + Float64(log(y) * Float64(-1.0 + x))) - t) end
function tmp = code(x, y, z, t) tmp = (((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.0)) + (log(y) * (-1.0 + x))) - t; end
code[x_, y_, z_, t_] := N[(N[(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] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(y \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right) \cdot \left(z + -1\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 90.3%
Taylor expanded in y around 0 99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (- (+ (* (* y (+ -1.0 (* y -0.5))) (+ z -1.0)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return (((y * (-1.0 + (y * -0.5))) * (z + -1.0)) + (log(y) * (-1.0 + x))) - 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 * ((-1.0d0) + (y * (-0.5d0)))) * (z + (-1.0d0))) + (log(y) * ((-1.0d0) + x))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((y * (-1.0 + (y * -0.5))) * (z + -1.0)) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return (((y * (-1.0 + (y * -0.5))) * (z + -1.0)) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(y * Float64(-1.0 + Float64(y * -0.5))) * Float64(z + -1.0)) + Float64(log(y) * Float64(-1.0 + x))) - t) end
function tmp = code(x, y, z, t) tmp = (((y * (-1.0 + (y * -0.5))) * (z + -1.0)) + (log(y) * (-1.0 + x))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(y * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(y \cdot \left(-1 + y \cdot -0.5\right)\right) \cdot \left(z + -1\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 90.3%
Taylor expanded in y around 0 99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.8e-16) (not (<= x 0.0014))) (- (* x (log y)) t) (- (- y (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e-16) || !(x <= 0.0014)) {
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 <= (-2.8d-16)) .or. (.not. (x <= 0.0014d0))) 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 <= -2.8e-16) || !(x <= 0.0014)) {
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 <= -2.8e-16) or not (x <= 0.0014): 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 <= -2.8e-16) || !(x <= 0.0014)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(y - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.8e-16) || ~((x <= 0.0014))) 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, -2.8e-16], N[Not[LessEqual[x, 0.0014]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-16} \lor \neg \left(x \leq 0.0014\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\end{array}
\end{array}
if x < -2.8000000000000001e-16 or 0.00139999999999999999 < x Initial program 93.6%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
mul-1-neg99.7%
fma-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 75.8%
associate-/l*75.6%
sub-neg75.6%
metadata-eval75.6%
+-commutative75.6%
associate-*r/75.6%
neg-mul-175.6%
Simplified75.6%
Taylor expanded in x around inf 92.7%
*-commutative92.7%
Simplified92.7%
if -2.8000000000000001e-16 < x < 0.00139999999999999999Initial program 85.5%
flip--85.5%
metadata-eval85.5%
metadata-eval85.5%
associate-*l/85.5%
metadata-eval85.5%
fma-neg85.5%
metadata-eval85.5%
+-commutative85.5%
Applied egg-rr85.5%
Taylor expanded in y around 0 98.8%
mul-1-neg98.8%
distribute-rgt-neg-in98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
distribute-neg-in98.8%
metadata-eval98.8%
unsub-neg98.8%
Simplified98.8%
Taylor expanded in x around 0 97.5%
+-commutative97.5%
mul-1-neg97.5%
sub-neg97.5%
Simplified97.5%
Taylor expanded in z around 0 82.5%
Final simplification88.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.0) (not (<= x 0.0014))) (- (* x (log y)) t) (- (- (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.0) || !(x <= 0.0014)) {
tmp = (x * log(y)) - t;
} else {
tmp = -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 <= 0.0014d0))) then
tmp = (x * log(y)) - t
else
tmp = -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 <= 0.0014)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = -Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.0) or not (x <= 0.0014): tmp = (x * math.log(y)) - t else: tmp = -math.log(y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.0) || !(x <= 0.0014)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(-log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.0) || ~((x <= 0.0014))) tmp = (x * log(y)) - t; else tmp = -log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 0.0014]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 0.0014\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\
\end{array}
\end{array}
if x < -1 or 0.00139999999999999999 < x Initial program 94.2%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
mul-1-neg99.7%
fma-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 75.6%
associate-/l*75.4%
sub-neg75.4%
metadata-eval75.4%
+-commutative75.4%
associate-*r/75.4%
neg-mul-175.4%
Simplified75.4%
Taylor expanded in x around inf 93.3%
*-commutative93.3%
Simplified93.3%
if -1 < x < 0.00139999999999999999Initial program 84.7%
flip--84.7%
metadata-eval84.7%
metadata-eval84.7%
associate-*l/84.7%
metadata-eval84.7%
fma-neg84.7%
metadata-eval84.7%
+-commutative84.7%
Applied egg-rr84.7%
Taylor expanded in y around 0 98.8%
mul-1-neg98.8%
distribute-rgt-neg-in98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
distribute-neg-in98.8%
metadata-eval98.8%
unsub-neg98.8%
Simplified98.8%
Taylor expanded in x around 0 97.5%
+-commutative97.5%
mul-1-neg97.5%
sub-neg97.5%
Simplified97.5%
Taylor expanded in y around 0 81.4%
neg-mul-181.4%
Simplified81.4%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.3e+44) (not (<= z 6.4e+155))) (- (* y (* z (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5))))) t) (- (- (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.3e+44) || !(z <= 6.4e+155)) {
tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t;
} else {
tmp = -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 ((z <= (-4.3d+44)) .or. (.not. (z <= 6.4d+155))) then
tmp = (y * (z * ((-1.0d0) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0))))) - t
else
tmp = -log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.3e+44) || !(z <= 6.4e+155)) {
tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t;
} else {
tmp = -Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.3e+44) or not (z <= 6.4e+155): tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t else: tmp = -math.log(y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.3e+44) || !(z <= 6.4e+155)) tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5))))) - t); else tmp = Float64(Float64(-log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.3e+44) || ~((z <= 6.4e+155))) tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t; else tmp = -log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.3e+44], N[Not[LessEqual[z, 6.4e+155]], $MachinePrecision]], N[(N[(y * N[(z * N[(-1.0 + N[(y * N[(N[(y * -0.3333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+44} \lor \neg \left(z \leq 6.4 \cdot 10^{+155}\right):\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\
\end{array}
\end{array}
if z < -4.29999999999999982e44 or 6.40000000000000024e155 < z Initial program 76.0%
Taylor expanded in y around 0 99.8%
Taylor expanded in x around 0 62.1%
mul-1-neg62.1%
Simplified62.1%
Taylor expanded in z around inf 60.5%
if -4.29999999999999982e44 < z < 6.40000000000000024e155Initial program 98.7%
flip--74.6%
metadata-eval74.6%
metadata-eval74.6%
associate-*l/73.4%
metadata-eval73.4%
fma-neg73.4%
metadata-eval73.4%
+-commutative73.4%
Applied egg-rr73.4%
Taylor expanded in y around 0 74.0%
mul-1-neg74.0%
distribute-rgt-neg-in74.0%
sub-neg74.0%
metadata-eval74.0%
+-commutative74.0%
distribute-neg-in74.0%
metadata-eval74.0%
unsub-neg74.0%
Simplified74.0%
Taylor expanded in x around 0 55.6%
+-commutative55.6%
mul-1-neg55.6%
sub-neg55.6%
Simplified55.6%
Taylor expanded in y around 0 54.3%
neg-mul-154.3%
Simplified54.3%
Final simplification56.6%
(FPCore (x y z t) :precision binary64 (- (- (* (log y) (+ -1.0 x)) (* y (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) - (y * (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 = ((log(y) * ((-1.0d0) + x)) - (y * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) - (y * (z + -1.0))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) - (y * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) - Float64(y * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) - (y * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 90.3%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
fma-define99.3%
mul-1-neg99.3%
fma-neg99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (if (<= z 8.5e+204) (- (* (log y) (+ -1.0 x)) t) (- (* y (* z (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5))))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 8.5e+204) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - 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 <= 8.5d+204) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = (y * (z * ((-1.0d0) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0))))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 8.5e+204) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 8.5e+204: tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 8.5e+204) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5))))) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 8.5e+204) tmp = (log(y) * (-1.0 + x)) - t; else tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 8.5e+204], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * N[(z * N[(-1.0 + N[(y * N[(N[(y * -0.3333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 8.5 \cdot 10^{+204}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right) - t\\
\end{array}
\end{array}
if z < 8.5e204Initial program 95.3%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
fma-define99.4%
mul-1-neg99.4%
fma-neg99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 83.1%
associate-/l*83.0%
sub-neg83.0%
metadata-eval83.0%
+-commutative83.0%
associate-*r/83.0%
neg-mul-183.0%
Simplified83.0%
Taylor expanded in y around 0 94.4%
if 8.5e204 < z Initial program 47.2%
Taylor expanded in y around 0 99.7%
Taylor expanded in x around 0 71.0%
mul-1-neg71.0%
Simplified71.0%
Taylor expanded in z around inf 70.9%
Final simplification92.0%
(FPCore (x y z t) :precision binary64 (- (- (* (log y) (+ -1.0 x)) (* z y)) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) - (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 = ((log(y) * ((-1.0d0) + x)) - (z * y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) - (z * y)) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) - (z * y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) - Float64(z * y)) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) - (z * y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) - z \cdot y\right) - t
\end{array}
Initial program 90.3%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
fma-define99.3%
mul-1-neg99.3%
fma-neg99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in z around inf 99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (- (* y (* z (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5))))) t))
double code(double x, double y, double z, double t) {
return (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 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) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0))))) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t;
}
def code(x, y, z, t): return (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(z * N[(-1.0 + N[(y * N[(N[(y * -0.3333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(z \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right) - t
\end{array}
Initial program 90.3%
Taylor expanded in y around 0 99.7%
Taylor expanded in x around 0 58.2%
mul-1-neg58.2%
Simplified58.2%
Taylor expanded in z around inf 44.1%
Final simplification44.1%
(FPCore (x y z t) :precision binary64 (- (* y (- 1.0 z)) t))
double code(double x, double y, double z, double t) {
return (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 = (y * (1.0d0 - z)) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) - t;
}
def code(x, y, z, t): return (y * (1.0 - z)) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(1.0 - z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * (1.0 - z)) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(1 - z\right) - t
\end{array}
Initial program 90.3%
flip--64.3%
metadata-eval64.3%
metadata-eval64.3%
associate-*l/63.5%
metadata-eval63.5%
fma-neg63.5%
metadata-eval63.5%
+-commutative63.5%
Applied egg-rr63.5%
Taylor expanded in y around 0 71.4%
mul-1-neg71.4%
distribute-rgt-neg-in71.4%
sub-neg71.4%
metadata-eval71.4%
+-commutative71.4%
distribute-neg-in71.4%
metadata-eval71.4%
unsub-neg71.4%
Simplified71.4%
Taylor expanded in y around inf 44.0%
(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 90.3%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
fma-define99.3%
mul-1-neg99.3%
fma-neg99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in z around inf 43.8%
associate-*r*43.8%
neg-mul-143.8%
Simplified43.8%
Final simplification43.8%
(FPCore (x y z t) :precision binary64 (- y t))
double code(double x, double y, double z, double t) {
return 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 = y - t
end function
public static double code(double x, double y, double z, double t) {
return y - t;
}
def code(x, y, z, t): return y - t
function code(x, y, z, t) return Float64(y - t) end
function tmp = code(x, y, z, t) tmp = y - t; end
code[x_, y_, z_, t_] := N[(y - t), $MachinePrecision]
\begin{array}{l}
\\
y - t
\end{array}
Initial program 90.3%
flip--64.3%
metadata-eval64.3%
metadata-eval64.3%
associate-*l/63.5%
metadata-eval63.5%
fma-neg63.5%
metadata-eval63.5%
+-commutative63.5%
Applied egg-rr63.5%
Taylor expanded in y around 0 71.4%
mul-1-neg71.4%
distribute-rgt-neg-in71.4%
sub-neg71.4%
metadata-eval71.4%
+-commutative71.4%
distribute-neg-in71.4%
metadata-eval71.4%
unsub-neg71.4%
Simplified71.4%
Taylor expanded in y around inf 44.0%
Taylor expanded in z around 0 34.6%
(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 90.3%
flip--64.3%
metadata-eval64.3%
metadata-eval64.3%
associate-*l/63.5%
metadata-eval63.5%
fma-neg63.5%
metadata-eval63.5%
+-commutative63.5%
Applied egg-rr63.5%
Taylor expanded in y around 0 71.4%
mul-1-neg71.4%
distribute-rgt-neg-in71.4%
sub-neg71.4%
metadata-eval71.4%
+-commutative71.4%
distribute-neg-in71.4%
metadata-eval71.4%
unsub-neg71.4%
Simplified71.4%
Taylor expanded in x around 0 57.8%
+-commutative57.8%
mul-1-neg57.8%
sub-neg57.8%
Simplified57.8%
Taylor expanded in t around inf 34.3%
neg-mul-134.3%
Simplified34.3%
herbie shell --seed 2024091
(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))