
(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)) (* (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.0%
+-commutative90.0%
fma-define90.0%
sub-neg90.0%
metadata-eval90.0%
sub-neg90.0%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (log y) (+ -1.0 x))
(*
(* 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 ((log(y) * (-1.0 + x)) + ((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 = ((log(y) * ((-1.0d0) + x)) + ((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 ((Math.log(y) * (-1.0 + x)) + ((y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))) * (z + -1.0))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((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(log(y) * Float64(-1.0 + x)) + 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 = ((log(y) * (-1.0 + x)) + ((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[Log[y], $MachinePrecision] * N[(-1.0 + x), $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(\log y \cdot \left(-1 + x\right) + \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 90.0%
Taylor expanded in y around 0 99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (- (log y)) t)) (t_2 (- (* x (log y)) t)))
(if (<= x -7.2)
t_2
(if (<= x 2.7e-245)
t_1
(if (<= x 1.82e-156) (- (* z (- y)) t) (if (<= x 1.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = -log(y) - t;
double t_2 = (x * log(y)) - t;
double tmp;
if (x <= -7.2) {
tmp = t_2;
} else if (x <= 2.7e-245) {
tmp = t_1;
} else if (x <= 1.82e-156) {
tmp = (z * -y) - t;
} else if (x <= 1.0) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = -log(y) - t
t_2 = (x * log(y)) - t
if (x <= (-7.2d0)) then
tmp = t_2
else if (x <= 2.7d-245) then
tmp = t_1
else if (x <= 1.82d-156) then
tmp = (z * -y) - t
else if (x <= 1.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -Math.log(y) - t;
double t_2 = (x * Math.log(y)) - t;
double tmp;
if (x <= -7.2) {
tmp = t_2;
} else if (x <= 2.7e-245) {
tmp = t_1;
} else if (x <= 1.82e-156) {
tmp = (z * -y) - t;
} else if (x <= 1.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = -math.log(y) - t t_2 = (x * math.log(y)) - t tmp = 0 if x <= -7.2: tmp = t_2 elif x <= 2.7e-245: tmp = t_1 elif x <= 1.82e-156: tmp = (z * -y) - t elif x <= 1.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-log(y)) - t) t_2 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -7.2) tmp = t_2; elseif (x <= 2.7e-245) tmp = t_1; elseif (x <= 1.82e-156) tmp = Float64(Float64(z * Float64(-y)) - t); elseif (x <= 1.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -log(y) - t; t_2 = (x * log(y)) - t; tmp = 0.0; if (x <= -7.2) tmp = t_2; elseif (x <= 2.7e-245) tmp = t_1; elseif (x <= 1.82e-156) tmp = (z * -y) - t; elseif (x <= 1.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -7.2], t$95$2, If[LessEqual[x, 2.7e-245], t$95$1, If[LessEqual[x, 1.82e-156], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 1.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\log y\right) - t\\
t_2 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -7.2:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-245}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.82 \cdot 10^{-156}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -7.20000000000000018 or 1 < x Initial program 95.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 72.9%
sub-neg72.9%
metadata-eval72.9%
+-commutative72.9%
mul-1-neg72.9%
Simplified72.9%
Taylor expanded in x around inf 94.9%
*-commutative94.9%
Simplified94.9%
if -7.20000000000000018 < x < 2.69999999999999989e-245 or 1.82e-156 < x < 1Initial program 89.8%
flip--89.8%
metadata-eval89.8%
metadata-eval89.8%
associate-*l/89.8%
metadata-eval89.8%
fma-neg89.8%
metadata-eval89.8%
+-commutative89.8%
Applied egg-rr89.8%
Taylor expanded in y around 0 98.7%
mul-1-neg98.7%
distribute-rgt-neg-in98.7%
sub-neg98.7%
metadata-eval98.7%
+-commutative98.7%
distribute-neg-in98.7%
metadata-eval98.7%
unsub-neg98.7%
Simplified98.7%
Taylor expanded in y around 0 88.2%
Taylor expanded in x around 0 87.7%
mul-1-neg87.7%
Simplified87.7%
if 2.69999999999999989e-245 < x < 1.82e-156Initial program 47.2%
Taylor expanded in y around 0 96.6%
+-commutative96.6%
sub-neg96.6%
metadata-eval96.6%
fma-define96.6%
mul-1-neg96.6%
fma-neg96.6%
+-commutative96.6%
sub-neg96.6%
metadata-eval96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in z around inf 84.6%
associate-*r*84.6%
neg-mul-184.6%
Simplified84.6%
Final simplification91.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -2e+15) (not (<= (+ -1.0 x) -0.5))) (- (* (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) <= -2e+15) || !((-1.0 + x) <= -0.5)) {
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) <= (-2d+15)) .or. (.not. (((-1.0d0) + x) <= (-0.5d0)))) 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) <= -2e+15) || !((-1.0 + x) <= -0.5)) {
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) <= -2e+15) or not ((-1.0 + x) <= -0.5): 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) <= -2e+15) || !(Float64(-1.0 + x) <= -0.5)) 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) <= -2e+15) || ~(((-1.0 + x) <= -0.5))) 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], -2e+15], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.5]], $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 -2 \cdot 10^{+15} \lor \neg \left(-1 + x \leq -0.5\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)) < -2e15 or -0.5 < (-.f64 x #s(literal 1 binary64)) Initial program 95.8%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.6%
mul-1-neg99.6%
fma-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 72.2%
sub-neg72.2%
metadata-eval72.2%
+-commutative72.2%
mul-1-neg72.2%
Simplified72.2%
Taylor expanded in y around 0 95.8%
if -2e15 < (-.f64 x #s(literal 1 binary64)) < -0.5Initial program 83.2%
Taylor expanded in y around 0 98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
fma-define98.5%
mul-1-neg98.5%
fma-neg98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in x around 0 98.1%
sub-neg98.1%
metadata-eval98.1%
+-commutative98.1%
sub-neg98.1%
+-commutative98.1%
mul-1-neg98.1%
unsub-neg98.1%
distribute-rgt-neg-in98.1%
distribute-neg-in98.1%
metadata-eval98.1%
sub-neg98.1%
Simplified98.1%
Final simplification96.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -2e+15) (not (<= (+ -1.0 x) -1.0))) (- (- (* x (log y)) (* z y)) t) (- (- (* y (- 1.0 z)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -2e+15) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * log(y)) - (z * y)) - 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) <= (-2d+15)) .or. (.not. (((-1.0d0) + x) <= (-1.0d0)))) then
tmp = ((x * log(y)) - (z * y)) - 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) <= -2e+15) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * Math.log(y)) - (z * y)) - 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) <= -2e+15) or not ((-1.0 + x) <= -1.0): tmp = ((x * math.log(y)) - (z * y)) - 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) <= -2e+15) || !(Float64(-1.0 + x) <= -1.0)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(z * y)) - 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) <= -2e+15) || ~(((-1.0 + x) <= -1.0))) tmp = ((x * log(y)) - (z * y)) - 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], -2e+15], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $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 -2 \cdot 10^{+15} \lor \neg \left(-1 + x \leq -1\right):\\
\;\;\;\;\left(x \cdot \log y - z \cdot y\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)) < -2e15 or -1 < (-.f64 x #s(literal 1 binary64)) Initial program 95.1%
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 99.7%
Taylor expanded in x around inf 99.3%
*-commutative99.3%
Simplified99.3%
if -2e15 < (-.f64 x #s(literal 1 binary64)) < -1Initial program 83.7%
Taylor expanded in y around 0 98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
fma-define98.5%
mul-1-neg98.5%
fma-neg98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in x around 0 98.0%
sub-neg98.0%
metadata-eval98.0%
+-commutative98.0%
sub-neg98.0%
+-commutative98.0%
mul-1-neg98.0%
unsub-neg98.0%
distribute-rgt-neg-in98.0%
distribute-neg-in98.0%
metadata-eval98.0%
sub-neg98.0%
Simplified98.0%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5)))) (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((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 = ((log(y) * ((-1.0d0) + x)) + ((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 ((Math.log(y) * (-1.0 + x)) + ((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.0))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + 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 = ((log(y) * (-1.0 + x)) + ((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $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(\log y \cdot \left(-1 + x\right) + \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 90.0%
Taylor expanded in y around 0 99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -2e+15) (not (<= (+ -1.0 x) -0.5))) (- (* (log y) (+ -1.0 x)) t) (- (- (- (log y)) (* z y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -2e+15) || !((-1.0 + x) <= -0.5)) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = (-log(y) - (z * y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((((-1.0d0) + x) <= (-2d+15)) .or. (.not. (((-1.0d0) + x) <= (-0.5d0)))) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = (-log(y) - (z * 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) <= -2e+15) || !((-1.0 + x) <= -0.5)) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = (-Math.log(y) - (z * y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -2e+15) or not ((-1.0 + x) <= -0.5): tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = (-math.log(y) - (z * y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -2e+15) || !(Float64(-1.0 + x) <= -0.5)) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(Float64(-log(y)) - Float64(z * y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -2e+15) || ~(((-1.0 + x) <= -0.5))) tmp = (log(y) * (-1.0 + x)) - t; else tmp = (-log(y) - (z * y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -2e+15], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.5]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[((-N[Log[y], $MachinePrecision]) - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -2 \cdot 10^{+15} \lor \neg \left(-1 + x \leq -0.5\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\log y\right) - z \cdot y\right) - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -2e15 or -0.5 < (-.f64 x #s(literal 1 binary64)) Initial program 95.8%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.6%
mul-1-neg99.6%
fma-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 72.2%
sub-neg72.2%
metadata-eval72.2%
+-commutative72.2%
mul-1-neg72.2%
Simplified72.2%
Taylor expanded in y around 0 95.8%
if -2e15 < (-.f64 x #s(literal 1 binary64)) < -0.5Initial program 83.2%
Taylor expanded in y around 0 98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
fma-define98.5%
mul-1-neg98.5%
fma-neg98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in z around inf 98.5%
Taylor expanded in x around 0 98.1%
mul-1-neg98.1%
Simplified98.1%
Final simplification96.8%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* y (* z (+ -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)) + (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 = ((log(y) * ((-1.0d0) + x)) + (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 ((Math.log(y) * (-1.0 + x)) + (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + (y * (z * (-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(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 = ((log(y) * (-1.0 + x)) + (y * (z * (-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[(y * N[(z * 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) + y \cdot \left(z \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 90.0%
Taylor expanded in y around 0 99.5%
Taylor expanded in z around inf 99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (* y (+ -1.0 (* y -0.5))) (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((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 = ((log(y) * ((-1.0d0) + x)) + ((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 ((Math.log(y) * (-1.0 + x)) + ((y * (-1.0 + (y * -0.5))) * (z + -1.0))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((y * (-1.0 + (y * -0.5))) * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(y * Float64(-1.0 + Float64(y * -0.5))) * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((y * (-1.0 + (y * -0.5))) * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $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(\log y \cdot \left(-1 + x\right) + \left(y \cdot \left(-1 + y \cdot -0.5\right)\right) \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 90.0%
Taylor expanded in y around 0 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* y (* z (+ -1.0 (* y -0.5))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + (y * (z * (-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)) + (y * (z * ((-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)) + (y * (z * (-1.0 + (y * -0.5))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + (y * (z * (-1.0 + (y * -0.5))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + (y * (z * (-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[(y * N[(z * 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) + y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right)\right) - t
\end{array}
Initial program 90.0%
Taylor expanded in y around 0 99.5%
Taylor expanded in z around inf 99.5%
Taylor expanded in y around 0 99.3%
Final simplification99.3%
(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.0%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
fma-define99.1%
mul-1-neg99.1%
fma-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (<= z 3.9e+229) (- (* (log y) (+ -1.0 x)) t) (- (* z (- y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.9e+229) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = (z * -y) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 3.9d+229) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = (z * -y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.9e+229) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = (z * -y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 3.9e+229: tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = (z * -y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 3.9e+229) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(z * Float64(-y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 3.9e+229) tmp = (log(y) * (-1.0 + x)) - t; else tmp = (z * -y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 3.9e+229], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.9 \cdot 10^{+229}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\end{array}
\end{array}
if z < 3.8999999999999998e229Initial program 93.5%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
fma-define99.1%
mul-1-neg99.1%
fma-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in z around inf 83.0%
sub-neg83.0%
metadata-eval83.0%
+-commutative83.0%
mul-1-neg83.0%
Simplified83.0%
Taylor expanded in y around 0 92.6%
if 3.8999999999999998e229 < z Initial program 28.7%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
fma-define99.8%
mul-1-neg99.8%
fma-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
associate-*r*78.4%
neg-mul-178.4%
Simplified78.4%
Final simplification91.8%
(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.0%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
fma-define99.1%
mul-1-neg99.1%
fma-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in z around inf 99.1%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (<= y 6.7e-78) (- (- (log y)) t) (- (* y (- 1.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.7e-78) {
tmp = -log(y) - t;
} else {
tmp = (y * (1.0 - z)) - 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 (y <= 6.7d-78) then
tmp = -log(y) - t
else
tmp = (y * (1.0d0 - z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.7e-78) {
tmp = -Math.log(y) - t;
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 6.7e-78: tmp = -math.log(y) - t else: tmp = (y * (1.0 - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 6.7e-78) tmp = Float64(Float64(-log(y)) - t); else tmp = Float64(Float64(y * Float64(1.0 - z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 6.7e-78) tmp = -log(y) - t; else tmp = (y * (1.0 - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 6.7e-78], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.7 \cdot 10^{-78}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if y < 6.69999999999999993e-78Initial program 95.2%
flip--69.6%
metadata-eval69.6%
metadata-eval69.6%
associate-*l/69.5%
metadata-eval69.5%
fma-neg69.5%
metadata-eval69.5%
+-commutative69.5%
Applied egg-rr69.5%
Taylor expanded in y around 0 74.1%
mul-1-neg74.1%
distribute-rgt-neg-in74.1%
sub-neg74.1%
metadata-eval74.1%
+-commutative74.1%
distribute-neg-in74.1%
metadata-eval74.1%
unsub-neg74.1%
Simplified74.1%
Taylor expanded in y around 0 69.5%
Taylor expanded in x around 0 56.2%
mul-1-neg56.2%
Simplified56.2%
if 6.69999999999999993e-78 < y Initial program 73.8%
Taylor expanded in y around 0 97.1%
+-commutative97.1%
sub-neg97.1%
metadata-eval97.1%
fma-define97.1%
mul-1-neg97.1%
fma-neg97.1%
+-commutative97.1%
sub-neg97.1%
metadata-eval97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in y around inf 52.9%
Final simplification55.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -270000000000.0) (not (<= t 1.2e+59))) (- t) (* y (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -270000000000.0) || !(t <= 1.2e+59)) {
tmp = -t;
} else {
tmp = y * (1.0 - z);
}
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 <= (-270000000000.0d0)) .or. (.not. (t <= 1.2d+59))) then
tmp = -t
else
tmp = y * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -270000000000.0) || !(t <= 1.2e+59)) {
tmp = -t;
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -270000000000.0) or not (t <= 1.2e+59): tmp = -t else: tmp = y * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -270000000000.0) || !(t <= 1.2e+59)) tmp = Float64(-t); else tmp = Float64(y * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -270000000000.0) || ~((t <= 1.2e+59))) tmp = -t; else tmp = y * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -270000000000.0], N[Not[LessEqual[t, 1.2e+59]], $MachinePrecision]], (-t), N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -270000000000 \lor \neg \left(t \leq 1.2 \cdot 10^{+59}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if t < -2.7e11 or 1.2000000000000001e59 < t Initial program 95.6%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
fma-define99.8%
mul-1-neg99.8%
fma-neg99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 71.9%
Taylor expanded in y around 0 67.7%
neg-mul-167.7%
Simplified67.7%
if -2.7e11 < t < 1.2000000000000001e59Initial program 85.5%
Taylor expanded in y around 0 98.6%
+-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
fma-define98.5%
mul-1-neg98.5%
fma-neg98.6%
+-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in y around inf 17.8%
Taylor expanded in y around inf 17.3%
Final simplification39.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -720000000000.0) (not (<= t 1.2e+59))) (- t) (* z (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -720000000000.0) || !(t <= 1.2e+59)) {
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 <= (-720000000000.0d0)) .or. (.not. (t <= 1.2d+59))) 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 <= -720000000000.0) || !(t <= 1.2e+59)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -720000000000.0) or not (t <= 1.2e+59): tmp = -t else: tmp = z * -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -720000000000.0) || !(t <= 1.2e+59)) 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 <= -720000000000.0) || ~((t <= 1.2e+59))) tmp = -t; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -720000000000.0], N[Not[LessEqual[t, 1.2e+59]], $MachinePrecision]], (-t), N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -720000000000 \lor \neg \left(t \leq 1.2 \cdot 10^{+59}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < -7.2e11 or 1.2000000000000001e59 < t Initial program 95.6%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
fma-define99.8%
mul-1-neg99.8%
fma-neg99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 71.9%
Taylor expanded in y around 0 67.7%
neg-mul-167.7%
Simplified67.7%
if -7.2e11 < t < 1.2000000000000001e59Initial program 85.5%
Taylor expanded in y around 0 98.6%
+-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
fma-define98.5%
mul-1-neg98.5%
fma-neg98.6%
+-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in y around inf 17.8%
Taylor expanded in z around inf 16.8%
associate-*r*16.8%
mul-1-neg16.8%
Simplified16.8%
Final simplification39.2%
(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.0%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
fma-define99.1%
mul-1-neg99.1%
fma-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in y around inf 41.7%
Final simplification41.7%
(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.0%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
fma-define99.1%
mul-1-neg99.1%
fma-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in z around inf 41.6%
associate-*r*41.6%
neg-mul-141.6%
Simplified41.6%
Final simplification41.6%
(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.0%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
fma-define99.1%
mul-1-neg99.1%
fma-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in y around inf 41.7%
Taylor expanded in z around 0 31.9%
Final simplification31.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 90.0%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
fma-define99.1%
mul-1-neg99.1%
fma-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in y around inf 41.7%
Taylor expanded in y around 0 31.7%
neg-mul-131.7%
Simplified31.7%
Final simplification31.7%
herbie shell --seed 2024072
(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))