
(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 20 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 89.0%
sub-neg89.0%
+-commutative89.0%
associate-+l+89.0%
fma-define89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.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)) (* (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 89.0%
+-commutative89.0%
fma-define89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (fma (+ -1.0 x) (log y) (* (log1p (- y)) (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return fma((-1.0 + x), log(y), (log1p(-y) * (z + -1.0))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(-1.0 + x), log(y), Float64(log1p(Float64(-y)) * Float64(z + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-1 + x, \log y, \mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 89.0%
fma-define89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
log1p-define99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (log y) (+ -1.0 x))
(*
y
(+
(*
y
(+
(* (+ z -1.0) -0.5)
(*
y
(+ (* (+ z -1.0) -0.3333333333333333) (* -0.25 (* y (+ z -1.0)))))))
(- 1.0 z))))
t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + (y * ((y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) + (-0.25 * (y * (z + -1.0))))))) + (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 = ((log(y) * ((-1.0d0) + x)) + (y * ((y * (((z + (-1.0d0)) * (-0.5d0)) + (y * (((z + (-1.0d0)) * (-0.3333333333333333d0)) + ((-0.25d0) * (y * (z + (-1.0d0)))))))) + (1.0d0 - z)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + (y * ((y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) + (-0.25 * (y * (z + -1.0))))))) + (1.0 - z)))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + (y * ((y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) + (-0.25 * (y * (z + -1.0))))))) + (1.0 - z)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(y * Float64(Float64(y * Float64(Float64(Float64(z + -1.0) * -0.5) + Float64(y * Float64(Float64(Float64(z + -1.0) * -0.3333333333333333) + Float64(-0.25 * Float64(y * Float64(z + -1.0))))))) + Float64(1.0 - z)))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + (y * ((y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) + (-0.25 * (y * (z + -1.0))))))) + (1.0 - z)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(y * N[(N[(N[(z + -1.0), $MachinePrecision] * -0.5), $MachinePrecision] + N[(y * N[(N[(N[(z + -1.0), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] + N[(-0.25 * N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + y \cdot \left(y \cdot \left(\left(z + -1\right) \cdot -0.5 + y \cdot \left(\left(z + -1\right) \cdot -0.3333333333333333 + -0.25 \cdot \left(y \cdot \left(z + -1\right)\right)\right)\right) + \left(1 - z\right)\right)\right) - t
\end{array}
Initial program 89.0%
Taylor expanded in y around 0 99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (log y) (+ -1.0 x))
(*
(+ z -1.0)
(* y (+ -1.0 (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5))))))
t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 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 = ((log(y) * ((-1.0d0) + x)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * ((y * ((y * (-0.25d0)) - 0.3333333333333333d0)) - 0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * Float64(Float64(y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * 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]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 89.0%
Taylor expanded in y around 0 99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -500000000.0) (not (<= (+ -1.0 x) -0.5))) (- (- (* x (log y)) (* z y)) t) (- (- t) (+ (log y) (* z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -500000000.0) || !((-1.0 + x) <= -0.5)) {
tmp = ((x * log(y)) - (z * y)) - t;
} else {
tmp = -t - (log(y) + (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 ((((-1.0d0) + x) <= (-500000000.0d0)) .or. (.not. (((-1.0d0) + x) <= (-0.5d0)))) then
tmp = ((x * log(y)) - (z * y)) - t
else
tmp = -t - (log(y) + (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -500000000.0) || !((-1.0 + x) <= -0.5)) {
tmp = ((x * Math.log(y)) - (z * y)) - t;
} else {
tmp = -t - (Math.log(y) + (z * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -500000000.0) or not ((-1.0 + x) <= -0.5): tmp = ((x * math.log(y)) - (z * y)) - t else: tmp = -t - (math.log(y) + (z * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -500000000.0) || !(Float64(-1.0 + x) <= -0.5)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(z * y)) - t); else tmp = Float64(Float64(-t) - Float64(log(y) + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -500000000.0) || ~(((-1.0 + x) <= -0.5))) tmp = ((x * log(y)) - (z * y)) - t; else tmp = -t - (log(y) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -500000000.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.5]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-t) - N[(N[Log[y], $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -500000000 \lor \neg \left(-1 + x \leq -0.5\right):\\
\;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - \left(\log y + z \cdot y\right)\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -5e8 or -0.5 < (-.f64 x #s(literal 1 binary64)) Initial program 92.2%
fma-define92.2%
sub-neg92.2%
metadata-eval92.2%
sub-neg92.2%
metadata-eval92.2%
sub-neg92.2%
log1p-define99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
unsub-neg99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in x around inf 99.0%
if -5e8 < (-.f64 x #s(literal 1 binary64)) < -0.5Initial program 85.6%
fma-define85.6%
sub-neg85.6%
metadata-eval85.6%
sub-neg85.6%
metadata-eval85.6%
sub-neg85.6%
log1p-define99.9%
Simplified99.9%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
unsub-neg99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in x around 0 98.2%
mul-1-neg98.2%
Simplified98.2%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) (+ -1.0 x))))
(if (<= (+ -1.0 x) -1.00000001)
(- t_1 t)
(if (<= (+ -1.0 x) 4e+16)
(- (- t) (+ (log y) (* z y)))
(- (+ y t_1) t)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * (-1.0 + x);
double tmp;
if ((-1.0 + x) <= -1.00000001) {
tmp = t_1 - t;
} else if ((-1.0 + x) <= 4e+16) {
tmp = -t - (log(y) + (z * y));
} else {
tmp = (y + t_1) - 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) :: t_1
real(8) :: tmp
t_1 = log(y) * ((-1.0d0) + x)
if (((-1.0d0) + x) <= (-1.00000001d0)) then
tmp = t_1 - t
else if (((-1.0d0) + x) <= 4d+16) then
tmp = -t - (log(y) + (z * y))
else
tmp = (y + t_1) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(y) * (-1.0 + x);
double tmp;
if ((-1.0 + x) <= -1.00000001) {
tmp = t_1 - t;
} else if ((-1.0 + x) <= 4e+16) {
tmp = -t - (Math.log(y) + (z * y));
} else {
tmp = (y + t_1) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * (-1.0 + x) tmp = 0 if (-1.0 + x) <= -1.00000001: tmp = t_1 - t elif (-1.0 + x) <= 4e+16: tmp = -t - (math.log(y) + (z * y)) else: tmp = (y + t_1) - t return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * Float64(-1.0 + x)) tmp = 0.0 if (Float64(-1.0 + x) <= -1.00000001) tmp = Float64(t_1 - t); elseif (Float64(-1.0 + x) <= 4e+16) tmp = Float64(Float64(-t) - Float64(log(y) + Float64(z * y))); else tmp = Float64(Float64(y + t_1) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * (-1.0 + x); tmp = 0.0; if ((-1.0 + x) <= -1.00000001) tmp = t_1 - t; elseif ((-1.0 + x) <= 4e+16) tmp = -t - (log(y) + (z * y)); else tmp = (y + t_1) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.00000001], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 4e+16], N[((-t) - N[(N[Log[y], $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + t$95$1), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(-1 + x\right)\\
\mathbf{if}\;-1 + x \leq -1.00000001:\\
\;\;\;\;t\_1 - t\\
\mathbf{elif}\;-1 + x \leq 4 \cdot 10^{+16}:\\
\;\;\;\;\left(-t\right) - \left(\log y + z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + t\_1\right) - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -1.0000000099999999Initial program 93.2%
fma-define93.2%
sub-neg93.2%
metadata-eval93.2%
sub-neg93.2%
metadata-eval93.2%
sub-neg93.2%
log1p-define99.6%
Simplified99.6%
Taylor expanded in y around 0 92.6%
if -1.0000000099999999 < (-.f64 x #s(literal 1 binary64)) < 4e16Initial program 84.2%
fma-define84.2%
sub-neg84.2%
metadata-eval84.2%
sub-neg84.2%
metadata-eval84.2%
sub-neg84.2%
log1p-define99.9%
Simplified99.9%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
unsub-neg99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in x around 0 98.5%
mul-1-neg98.5%
Simplified98.5%
if 4e16 < (-.f64 x #s(literal 1 binary64)) Initial program 94.1%
add-sqr-sqrt0.0%
pow20.0%
sub-neg0.0%
metadata-eval0.0%
*-commutative0.0%
Applied egg-rr0.0%
Taylor expanded in y around 0 0.0%
mul-1-neg0.0%
Simplified0.0%
Taylor expanded in z around 0 92.6%
Final simplification95.5%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (+ z -1.0) (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5)))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-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 = ((log(y) * ((-1.0d0) + x)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5)))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * N[(N[(y * -0.3333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 89.0%
Taylor expanded in y around 0 99.7%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -1.00000001)
(- (* (log y) (+ -1.0 x)) t)
(if (<= (+ -1.0 x) 4e+16)
(- (- t) (+ (log y) (* z y)))
(- (* x (log y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -1.00000001) {
tmp = (log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 4e+16) {
tmp = -t - (log(y) + (z * y));
} else {
tmp = (x * 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) <= (-1.00000001d0)) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else if (((-1.0d0) + x) <= 4d+16) then
tmp = -t - (log(y) + (z * y))
else
tmp = (x * 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) <= -1.00000001) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 4e+16) {
tmp = -t - (Math.log(y) + (z * y));
} else {
tmp = (x * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -1.00000001: tmp = (math.log(y) * (-1.0 + x)) - t elif (-1.0 + x) <= 4e+16: tmp = -t - (math.log(y) + (z * y)) else: tmp = (x * math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -1.00000001) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); elseif (Float64(-1.0 + x) <= 4e+16) tmp = Float64(Float64(-t) - Float64(log(y) + Float64(z * y))); else tmp = Float64(Float64(x * log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -1.00000001) tmp = (log(y) * (-1.0 + x)) - t; elseif ((-1.0 + x) <= 4e+16) tmp = -t - (log(y) + (z * y)); else tmp = (x * log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.00000001], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 4e+16], N[((-t) - N[(N[Log[y], $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -1.00000001:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{elif}\;-1 + x \leq 4 \cdot 10^{+16}:\\
\;\;\;\;\left(-t\right) - \left(\log y + z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -1.0000000099999999Initial program 93.2%
fma-define93.2%
sub-neg93.2%
metadata-eval93.2%
sub-neg93.2%
metadata-eval93.2%
sub-neg93.2%
log1p-define99.6%
Simplified99.6%
Taylor expanded in y around 0 92.6%
if -1.0000000099999999 < (-.f64 x #s(literal 1 binary64)) < 4e16Initial program 84.2%
fma-define84.2%
sub-neg84.2%
metadata-eval84.2%
sub-neg84.2%
metadata-eval84.2%
sub-neg84.2%
log1p-define99.9%
Simplified99.9%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
unsub-neg99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in x around 0 98.5%
mul-1-neg98.5%
Simplified98.5%
if 4e16 < (-.f64 x #s(literal 1 binary64)) Initial program 94.1%
fma-define94.1%
sub-neg94.1%
metadata-eval94.1%
sub-neg94.1%
metadata-eval94.1%
sub-neg94.1%
log1p-define99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 92.6%
*-commutative92.6%
Simplified92.6%
Final simplification95.5%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (+ z -1.0) (* y (+ -1.0 (* y -0.5))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-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 = ((log(y) * ((-1.0d0) + x)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * (-0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * -0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot -0.5\right)\right)\right) - t
\end{array}
Initial program 89.0%
Taylor expanded in y around 0 99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.5e-76) (not (<= x 2.15e+16))) (- (* x (log y)) t) (- (* z (log1p (- y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.5e-76) || !(x <= 2.15e+16)) {
tmp = (x * log(y)) - t;
} else {
tmp = (z * log1p(-y)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.5e-76) || !(x <= 2.15e+16)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = (z * Math.log1p(-y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.5e-76) or not (x <= 2.15e+16): tmp = (x * math.log(y)) - t else: tmp = (z * math.log1p(-y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.5e-76) || !(x <= 2.15e+16)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(z * log1p(Float64(-y))) - t); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.5e-76], N[Not[LessEqual[x, 2.15e+16]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-76} \lor \neg \left(x \leq 2.15 \cdot 10^{+16}\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\end{array}
\end{array}
if x < -7.4999999999999997e-76 or 2.15e16 < x Initial program 94.2%
fma-define94.2%
sub-neg94.2%
metadata-eval94.2%
sub-neg94.2%
metadata-eval94.2%
sub-neg94.2%
log1p-define99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 87.3%
*-commutative87.3%
Simplified87.3%
if -7.4999999999999997e-76 < x < 2.15e16Initial program 82.2%
flip--82.2%
metadata-eval82.2%
metadata-eval82.2%
associate-*l/82.2%
metadata-eval82.2%
fma-neg82.2%
metadata-eval82.2%
+-commutative82.2%
Applied egg-rr82.2%
Taylor expanded in z around inf 44.4%
sub-neg44.4%
log1p-undefine61.3%
Simplified61.3%
Final simplification75.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.2e-76) (not (<= x 2.15e+16))) (- (* x (log y)) 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 ((x <= -5.2e-76) || !(x <= 2.15e+16)) {
tmp = (x * log(y)) - 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 ((x <= (-5.2d-76)) .or. (.not. (x <= 2.15d+16))) then
tmp = (x * log(y)) - 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 ((x <= -5.2e-76) || !(x <= 2.15e+16)) {
tmp = (x * Math.log(y)) - 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 (x <= -5.2e-76) or not (x <= 2.15e+16): tmp = (x * math.log(y)) - 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 ((x <= -5.2e-76) || !(x <= 2.15e+16)) tmp = Float64(Float64(x * log(y)) - 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 ((x <= -5.2e-76) || ~((x <= 2.15e+16))) tmp = (x * log(y)) - 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[Or[LessEqual[x, -5.2e-76], N[Not[LessEqual[x, 2.15e+16]], $MachinePrecision]], N[(N[(x * N[Log[y], $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}\;x \leq -5.2 \cdot 10^{-76} \lor \neg \left(x \leq 2.15 \cdot 10^{+16}\right):\\
\;\;\;\;x \cdot \log y - 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 x < -5.1999999999999999e-76 or 2.15e16 < x Initial program 94.2%
fma-define94.2%
sub-neg94.2%
metadata-eval94.2%
sub-neg94.2%
metadata-eval94.2%
sub-neg94.2%
log1p-define99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 87.3%
*-commutative87.3%
Simplified87.3%
if -5.1999999999999999e-76 < x < 2.15e16Initial program 82.2%
Taylor expanded in y around 0 99.9%
add-cbrt-cube99.5%
pow399.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*l*99.4%
Simplified99.4%
Taylor expanded in z around inf 61.2%
Final simplification75.9%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + (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 = ((log(y) * ((-1.0d0) + x)) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 89.0%
fma-define89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
log1p-define99.8%
Simplified99.8%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
mul-1-neg99.3%
unsub-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 4.5e+194) (- (* (log y) (+ -1.0 x)) t) (- (* z (log1p (- y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.5e+194) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = (z * log1p(-y)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.5e+194) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = (z * Math.log1p(-y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 4.5e+194: tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = (z * math.log1p(-y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 4.5e+194) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(z * log1p(Float64(-y))) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, 4.5e+194], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.5 \cdot 10^{+194}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\end{array}
\end{array}
if z < 4.4999999999999998e194Initial program 92.9%
fma-define92.9%
sub-neg92.9%
metadata-eval92.9%
sub-neg92.9%
metadata-eval92.9%
sub-neg92.9%
log1p-define99.8%
Simplified99.8%
Taylor expanded in y around 0 92.2%
if 4.4999999999999998e194 < z Initial program 52.7%
flip--30.5%
metadata-eval30.5%
metadata-eval30.5%
associate-*l/30.5%
metadata-eval30.5%
fma-neg30.5%
metadata-eval30.5%
+-commutative30.5%
Applied egg-rr30.5%
Taylor expanded in z around inf 36.1%
sub-neg36.1%
log1p-undefine83.2%
Simplified83.2%
Final simplification91.3%
(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 89.0%
fma-define89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
log1p-define99.8%
Simplified99.8%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
unsub-neg99.2%
+-commutative99.2%
Simplified99.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 89.0%
Taylor expanded in y around 0 99.8%
add-cbrt-cube99.4%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*l*99.4%
Simplified99.4%
Taylor expanded in z around inf 45.3%
Final simplification45.3%
(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 89.0%
add-sqr-sqrt66.6%
pow266.6%
sub-neg66.6%
metadata-eval66.6%
*-commutative66.6%
Applied egg-rr66.6%
Taylor expanded in y around 0 75.1%
mul-1-neg75.1%
Simplified75.1%
Taylor expanded in y around inf 45.1%
mul-1-neg45.1%
distribute-rgt-neg-in45.1%
mul-1-neg45.1%
sub-neg45.1%
metadata-eval45.1%
+-commutative45.1%
neg-mul-145.1%
distribute-neg-in45.1%
metadata-eval45.1%
unsub-neg45.1%
Simplified45.1%
(FPCore (x y z t) :precision binary64 (- (* y (- z)) t))
double code(double x, double y, double z, double t) {
return (y * -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 * -z) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * -z) - t;
}
def code(x, y, z, t): return (y * -z) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(-z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * -z) - t; end
code[x_, y_, z_, t_] := N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-z\right) - t
\end{array}
Initial program 89.0%
fma-define89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
log1p-define99.8%
Simplified99.8%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
unsub-neg99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in y around inf 44.9%
neg-mul-144.9%
distribute-lft-neg-in44.9%
*-commutative44.9%
Simplified44.9%
Final simplification44.9%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t
end function
public static double code(double x, double y, double z, double t) {
return -t;
}
def code(x, y, z, t): return -t
function code(x, y, z, t) return Float64(-t) end
function tmp = code(x, y, z, t) tmp = -t; end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 89.0%
fma-define89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
log1p-define99.8%
Simplified99.8%
Taylor expanded in t around inf 34.3%
mul-1-neg34.3%
Simplified34.3%
(FPCore (x y z t) :precision binary64 0.0)
double code(double x, double y, double z, double t) {
return 0.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 0.0d0
end function
public static double code(double x, double y, double z, double t) {
return 0.0;
}
def code(x, y, z, t): return 0.0
function code(x, y, z, t) return 0.0 end
function tmp = code(x, y, z, t) tmp = 0.0; end
code[x_, y_, z_, t_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 89.0%
fma-define89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
log1p-define99.8%
Simplified99.8%
Taylor expanded in t around inf 34.3%
mul-1-neg34.3%
Simplified34.3%
expm1-log1p-u18.2%
expm1-undefine18.0%
Applied egg-rr18.0%
sub-neg18.0%
log1p-undefine18.0%
rem-exp-log34.2%
unsub-neg34.2%
metadata-eval34.2%
Simplified34.2%
Taylor expanded in t around 0 2.3%
metadata-eval2.3%
Applied egg-rr2.3%
herbie shell --seed 2024146
(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))