
(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 18 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 90.5%
sub-neg90.5%
+-commutative90.5%
associate-+l+90.5%
fma-define90.5%
sub-neg90.5%
metadata-eval90.5%
sub-neg90.5%
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 (+ -1.0 x) (log y) (* (+ z -1.0) (log1p (- y)))) t))
double code(double x, double y, double z, double t) {
return fma((-1.0 + x), log(y), ((z + -1.0) * log1p(-y))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(-1.0 + x), log(y), Float64(Float64(z + -1.0) * log1p(Float64(-y)))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-1 + x, \log y, \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right)\right) - t
\end{array}
Initial program 90.5%
fma-define90.5%
sub-neg90.5%
metadata-eval90.5%
sub-neg90.5%
metadata-eval90.5%
sub-neg90.5%
log1p-define99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (+ -1.0 x) (log y))
(*
(+ 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 (((-1.0 + x) * log(y)) + ((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 = ((((-1.0d0) + x) * log(y)) + ((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 (((-1.0 + x) * Math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((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(Float64(-1.0 + x) * log(y)) + 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 = (((-1.0 + x) * log(y)) + ((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[(-1.0 + x), $MachinePrecision] * N[Log[y], $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(\left(-1 + x\right) \cdot \log y + \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 90.5%
Taylor expanded in y around 0 99.7%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (+ -1.0 x) (log y))))
(if (<= (+ -1.0 x) -100000.0)
(- t_1 t)
(if (<= (+ -1.0 x) -1.0)
(- (- (* y (- 1.0 z)) t) (log y))
(- (+ y t_1) t)))))
double code(double x, double y, double z, double t) {
double t_1 = (-1.0 + x) * log(y);
double tmp;
if ((-1.0 + x) <= -100000.0) {
tmp = t_1 - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = ((y * (1.0 - z)) - t) - log(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 = ((-1.0d0) + x) * log(y)
if (((-1.0d0) + x) <= (-100000.0d0)) then
tmp = t_1 - t
else if (((-1.0d0) + x) <= (-1.0d0)) then
tmp = ((y * (1.0d0 - z)) - t) - log(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 = (-1.0 + x) * Math.log(y);
double tmp;
if ((-1.0 + x) <= -100000.0) {
tmp = t_1 - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = ((y * (1.0 - z)) - t) - Math.log(y);
} else {
tmp = (y + t_1) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (-1.0 + x) * math.log(y) tmp = 0 if (-1.0 + x) <= -100000.0: tmp = t_1 - t elif (-1.0 + x) <= -1.0: tmp = ((y * (1.0 - z)) - t) - math.log(y) else: tmp = (y + t_1) - t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-1.0 + x) * log(y)) tmp = 0.0 if (Float64(-1.0 + x) <= -100000.0) tmp = Float64(t_1 - t); elseif (Float64(-1.0 + x) <= -1.0) tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - t) - log(y)); else tmp = Float64(Float64(y + t_1) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (-1.0 + x) * log(y); tmp = 0.0; if ((-1.0 + x) <= -100000.0) tmp = t_1 - t; elseif ((-1.0 + x) <= -1.0) tmp = ((y * (1.0 - z)) - t) - log(y); else tmp = (y + t_1) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(-1.0 + x), $MachinePrecision], -100000.0], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y + t$95$1), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-1 + x\right) \cdot \log y\\
\mathbf{if}\;-1 + x \leq -100000:\\
\;\;\;\;t\_1 - t\\
\mathbf{elif}\;-1 + x \leq -1:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - t\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;\left(y + t\_1\right) - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -1e5Initial program 95.2%
Taylor expanded in y around 0 95.2%
if -1e5 < (-.f64 x #s(literal 1 binary64)) < -1Initial program 85.1%
flip--85.1%
metadata-eval85.1%
metadata-eval85.1%
associate-*l/85.1%
metadata-eval85.1%
fma-neg85.1%
metadata-eval85.1%
+-commutative85.1%
Applied egg-rr85.1%
Taylor expanded in x around 0 85.1%
+-commutative85.1%
mul-1-neg85.1%
sub-neg85.1%
sub-neg85.1%
metadata-eval85.1%
sub-neg85.1%
log1p-undefine99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 99.5%
sub-neg99.5%
metadata-eval99.5%
neg-mul-199.5%
distribute-rgt-neg-in99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
sub-neg99.5%
Simplified99.5%
Taylor expanded in t around 0 99.5%
if -1 < (-.f64 x #s(literal 1 binary64)) Initial program 97.2%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
mul-1-neg99.7%
unsub-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 97.2%
sub-neg97.2%
metadata-eval97.2%
+-commutative97.2%
mul-1-neg97.2%
Simplified97.2%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (+ -1.0 x) (log y))))
(if (<= (+ -1.0 x) -100000.0)
(- t_1 t)
(if (<= (+ -1.0 x) -1.0)
(- (- (* y (- 1.0 z)) (log y)) t)
(- (+ y t_1) t)))))
double code(double x, double y, double z, double t) {
double t_1 = (-1.0 + x) * log(y);
double tmp;
if ((-1.0 + x) <= -100000.0) {
tmp = t_1 - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = ((y * (1.0 - z)) - log(y)) - t;
} 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 = ((-1.0d0) + x) * log(y)
if (((-1.0d0) + x) <= (-100000.0d0)) then
tmp = t_1 - t
else if (((-1.0d0) + x) <= (-1.0d0)) then
tmp = ((y * (1.0d0 - z)) - log(y)) - t
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 = (-1.0 + x) * Math.log(y);
double tmp;
if ((-1.0 + x) <= -100000.0) {
tmp = t_1 - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
} else {
tmp = (y + t_1) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (-1.0 + x) * math.log(y) tmp = 0 if (-1.0 + x) <= -100000.0: tmp = t_1 - t elif (-1.0 + x) <= -1.0: tmp = ((y * (1.0 - z)) - math.log(y)) - t else: tmp = (y + t_1) - t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-1.0 + x) * log(y)) tmp = 0.0 if (Float64(-1.0 + x) <= -100000.0) tmp = Float64(t_1 - t); elseif (Float64(-1.0 + x) <= -1.0) tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); else tmp = Float64(Float64(y + t_1) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (-1.0 + x) * log(y); tmp = 0.0; if ((-1.0 + x) <= -100000.0) tmp = t_1 - t; elseif ((-1.0 + x) <= -1.0) tmp = ((y * (1.0 - z)) - log(y)) - t; else tmp = (y + t_1) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(-1.0 + x), $MachinePrecision], -100000.0], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y + t$95$1), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-1 + x\right) \cdot \log y\\
\mathbf{if}\;-1 + x \leq -100000:\\
\;\;\;\;t\_1 - t\\
\mathbf{elif}\;-1 + x \leq -1:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y + t\_1\right) - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -1e5Initial program 95.2%
Taylor expanded in y around 0 95.2%
if -1e5 < (-.f64 x #s(literal 1 binary64)) < -1Initial program 85.1%
flip--85.1%
metadata-eval85.1%
metadata-eval85.1%
associate-*l/85.1%
metadata-eval85.1%
fma-neg85.1%
metadata-eval85.1%
+-commutative85.1%
Applied egg-rr85.1%
Taylor expanded in x around 0 85.1%
+-commutative85.1%
mul-1-neg85.1%
sub-neg85.1%
sub-neg85.1%
metadata-eval85.1%
sub-neg85.1%
log1p-undefine99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 99.5%
sub-neg99.5%
metadata-eval99.5%
neg-mul-199.5%
distribute-rgt-neg-in99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
sub-neg99.5%
Simplified99.5%
if -1 < (-.f64 x #s(literal 1 binary64)) Initial program 97.2%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
mul-1-neg99.7%
unsub-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 97.2%
sub-neg97.2%
metadata-eval97.2%
+-commutative97.2%
mul-1-neg97.2%
Simplified97.2%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* (+ z -1.0) (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5)))))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + ((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 = ((((-1.0d0) + x) * log(y)) + ((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 (((-1.0 + x) * Math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + 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 = (((-1.0 + x) * log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $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(\left(-1 + x\right) \cdot \log y + \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 90.5%
Taylor expanded in y around 0 99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* (+ z -1.0) (* y (+ -1.0 (* y -0.5))))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + ((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 = ((((-1.0d0) + x) * log(y)) + ((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 (((-1.0 + x) * Math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * -0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $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(\left(-1 + x\right) \cdot \log y + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot -0.5\right)\right)\right) - t
\end{array}
Initial program 90.5%
Taylor expanded in y around 0 99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2e-13) (not (<= x 1.0))) (- (* x (log y)) t) (- (- y (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2e-13) || !(x <= 1.0)) {
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 <= (-2d-13)) .or. (.not. (x <= 1.0d0))) 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 <= -2e-13) || !(x <= 1.0)) {
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 <= -2e-13) or not (x <= 1.0): 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 <= -2e-13) || !(x <= 1.0)) 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 <= -2e-13) || ~((x <= 1.0))) 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, -2e-13], N[Not[LessEqual[x, 1.0]], $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 \cdot 10^{-13} \lor \neg \left(x \leq 1\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\end{array}
\end{array}
if x < -2.0000000000000001e-13 or 1 < x Initial program 95.4%
Taylor expanded in y around 0 99.6%
Taylor expanded in y around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 94.8%
*-commutative94.8%
Simplified94.8%
if -2.0000000000000001e-13 < x < 1Initial program 86.2%
flip--86.2%
metadata-eval86.2%
metadata-eval86.2%
associate-*l/86.2%
metadata-eval86.2%
fma-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Applied egg-rr86.2%
Taylor expanded in x around 0 85.6%
+-commutative85.6%
mul-1-neg85.6%
sub-neg85.6%
sub-neg85.6%
metadata-eval85.6%
sub-neg85.6%
log1p-undefine99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in y around 0 98.9%
sub-neg98.9%
metadata-eval98.9%
neg-mul-198.9%
distribute-rgt-neg-in98.9%
+-commutative98.9%
distribute-neg-in98.9%
metadata-eval98.9%
sub-neg98.9%
Simplified98.9%
Taylor expanded in z around 0 84.8%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2e-13) (not (<= x 1.0))) (- (* x (log y)) t) (- (- t) (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2e-13) || !(x <= 1.0)) {
tmp = (x * log(y)) - t;
} else {
tmp = -t - log(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 ((x <= (-2d-13)) .or. (.not. (x <= 1.0d0))) then
tmp = (x * log(y)) - t
else
tmp = -t - log(y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2e-13) || !(x <= 1.0)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = -t - Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2e-13) or not (x <= 1.0): tmp = (x * math.log(y)) - t else: tmp = -t - math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2e-13) || !(x <= 1.0)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(-t) - log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2e-13) || ~((x <= 1.0))) tmp = (x * log(y)) - t; else tmp = -t - log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2e-13], N[Not[LessEqual[x, 1.0]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-13} \lor \neg \left(x \leq 1\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - \log y\\
\end{array}
\end{array}
if x < -2.0000000000000001e-13 or 1 < x Initial program 95.4%
Taylor expanded in y around 0 99.6%
Taylor expanded in y around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 94.8%
*-commutative94.8%
Simplified94.8%
if -2.0000000000000001e-13 < x < 1Initial program 86.2%
flip--86.2%
metadata-eval86.2%
metadata-eval86.2%
associate-*l/86.2%
metadata-eval86.2%
fma-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Applied egg-rr86.2%
Taylor expanded in x around 0 85.6%
+-commutative85.6%
mul-1-neg85.6%
sub-neg85.6%
sub-neg85.6%
metadata-eval85.6%
sub-neg85.6%
log1p-undefine99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in y around 0 98.9%
sub-neg98.9%
metadata-eval98.9%
neg-mul-198.9%
distribute-rgt-neg-in98.9%
+-commutative98.9%
distribute-neg-in98.9%
metadata-eval98.9%
sub-neg98.9%
Simplified98.9%
Taylor expanded in y around 0 84.5%
mul-1-neg84.5%
Simplified84.5%
Final simplification89.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -25500000000.0) (not (<= x 1.05e+15))) (* x (log y)) (- (- t) (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -25500000000.0) || !(x <= 1.05e+15)) {
tmp = x * log(y);
} else {
tmp = -t - log(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 ((x <= (-25500000000.0d0)) .or. (.not. (x <= 1.05d+15))) then
tmp = x * log(y)
else
tmp = -t - log(y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -25500000000.0) || !(x <= 1.05e+15)) {
tmp = x * Math.log(y);
} else {
tmp = -t - Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -25500000000.0) or not (x <= 1.05e+15): tmp = x * math.log(y) else: tmp = -t - math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -25500000000.0) || !(x <= 1.05e+15)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-t) - log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -25500000000.0) || ~((x <= 1.05e+15))) tmp = x * log(y); else tmp = -t - log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -25500000000.0], N[Not[LessEqual[x, 1.05e+15]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -25500000000 \lor \neg \left(x \leq 1.05 \cdot 10^{+15}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - \log y\\
\end{array}
\end{array}
if x < -2.55e10 or 1.05e15 < x Initial program 96.1%
Taylor expanded in t around inf 76.1%
associate--l+76.1%
sub-neg76.1%
metadata-eval76.1%
associate-/l*76.0%
+-commutative76.0%
associate-/l*74.8%
sub-neg74.8%
metadata-eval74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in x around inf 76.9%
*-commutative76.9%
Simplified76.9%
if -2.55e10 < x < 1.05e15Initial program 86.1%
flip--86.1%
metadata-eval86.1%
metadata-eval86.1%
associate-*l/86.1%
metadata-eval86.1%
fma-neg86.1%
metadata-eval86.1%
+-commutative86.1%
Applied egg-rr86.1%
Taylor expanded in x around 0 84.8%
+-commutative84.8%
mul-1-neg84.8%
sub-neg84.8%
sub-neg84.8%
metadata-eval84.8%
sub-neg84.8%
log1p-undefine98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in y around 0 98.2%
sub-neg98.2%
metadata-eval98.2%
neg-mul-198.2%
distribute-rgt-neg-in98.2%
+-commutative98.2%
distribute-neg-in98.2%
metadata-eval98.2%
sub-neg98.2%
Simplified98.2%
Taylor expanded in y around 0 83.7%
mul-1-neg83.7%
Simplified83.7%
Final simplification80.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -11500000000.0) (not (<= x 4.6e+17))) (* x (log y)) (- (- t) (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -11500000000.0) || !(x <= 4.6e+17)) {
tmp = x * log(y);
} else {
tmp = -t - log(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 ((x <= (-11500000000.0d0)) .or. (.not. (x <= 4.6d+17))) then
tmp = x * log(y)
else
tmp = -t - log(y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -11500000000.0) || !(x <= 4.6e+17)) {
tmp = x * Math.log(y);
} else {
tmp = -t - Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -11500000000.0) or not (x <= 4.6e+17): tmp = x * math.log(y) else: tmp = -t - math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -11500000000.0) || !(x <= 4.6e+17)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-t) - log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -11500000000.0) || ~((x <= 4.6e+17))) tmp = x * log(y); else tmp = -t - log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -11500000000.0], N[Not[LessEqual[x, 4.6e+17]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -11500000000 \lor \neg \left(x \leq 4.6 \cdot 10^{+17}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - \log y\\
\end{array}
\end{array}
if x < -1.15e10 or 4.6e17 < x Initial program 96.1%
Taylor expanded in t around inf 76.1%
associate--l+76.1%
sub-neg76.1%
metadata-eval76.1%
associate-/l*76.0%
+-commutative76.0%
associate-/l*74.8%
sub-neg74.8%
metadata-eval74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in x around inf 76.9%
*-commutative76.9%
Simplified76.9%
if -1.15e10 < x < 4.6e17Initial program 86.1%
flip--86.1%
metadata-eval86.1%
metadata-eval86.1%
associate-*l/86.1%
metadata-eval86.1%
fma-neg86.1%
metadata-eval86.1%
+-commutative86.1%
Applied egg-rr86.1%
Taylor expanded in x around 0 84.8%
+-commutative84.8%
mul-1-neg84.8%
sub-neg84.8%
sub-neg84.8%
metadata-eval84.8%
sub-neg84.8%
log1p-undefine98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in y around 0 83.7%
mul-1-neg83.7%
distribute-neg-in83.7%
unsub-neg83.7%
Simplified83.7%
Final simplification80.7%
(FPCore (x y z t) :precision binary64 (if (<= z 2.8e+200) (- (+ y (* (+ -1.0 x) (log y))) t) (- (* y (- 1.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.8e+200) {
tmp = (y + ((-1.0 + x) * 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 (z <= 2.8d+200) then
tmp = (y + (((-1.0d0) + x) * 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 (z <= 2.8e+200) {
tmp = (y + ((-1.0 + x) * Math.log(y))) - t;
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 2.8e+200: tmp = (y + ((-1.0 + x) * math.log(y))) - t else: tmp = (y * (1.0 - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 2.8e+200) tmp = Float64(Float64(y + Float64(Float64(-1.0 + x) * 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 (z <= 2.8e+200) tmp = (y + ((-1.0 + x) * log(y))) - t; else tmp = (y * (1.0 - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 2.8e+200], N[(N[(y + N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.8 \cdot 10^{+200}:\\
\;\;\;\;\left(y + \left(-1 + x\right) \cdot \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if z < 2.79999999999999985e200Initial program 96.8%
fma-define96.8%
sub-neg96.8%
metadata-eval96.8%
sub-neg96.8%
metadata-eval96.8%
sub-neg96.8%
log1p-define99.8%
Simplified99.8%
Taylor expanded in y around 0 99.6%
mul-1-neg99.6%
distribute-rgt-neg-in99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in z around 0 96.4%
if 2.79999999999999985e200 < z Initial program 37.0%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
mul-1-neg99.8%
unsub-neg99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 79.1%
Final simplification94.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5800000000.0) (not (<= x 2.25e+67))) (* x (log y)) (- (* y (- 1.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5800000000.0) || !(x <= 2.25e+67)) {
tmp = x * log(y);
} 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 ((x <= (-5800000000.0d0)) .or. (.not. (x <= 2.25d+67))) then
tmp = x * log(y)
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 ((x <= -5800000000.0) || !(x <= 2.25e+67)) {
tmp = x * Math.log(y);
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5800000000.0) or not (x <= 2.25e+67): tmp = x * math.log(y) else: tmp = (y * (1.0 - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5800000000.0) || !(x <= 2.25e+67)) tmp = Float64(x * log(y)); 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 ((x <= -5800000000.0) || ~((x <= 2.25e+67))) tmp = x * log(y); else tmp = (y * (1.0 - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5800000000.0], N[Not[LessEqual[x, 2.25e+67]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5800000000 \lor \neg \left(x \leq 2.25 \cdot 10^{+67}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if x < -5.8e9 or 2.2499999999999999e67 < x Initial program 95.7%
Taylor expanded in t around inf 74.7%
associate--l+74.7%
sub-neg74.7%
metadata-eval74.7%
associate-/l*74.6%
+-commutative74.6%
associate-/l*73.3%
sub-neg73.3%
metadata-eval73.3%
+-commutative73.3%
Simplified73.3%
Taylor expanded in x around inf 79.4%
*-commutative79.4%
Simplified79.4%
if -5.8e9 < x < 2.2499999999999999e67Initial program 87.0%
Taylor expanded in y around 0 99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
mul-1-neg99.5%
unsub-neg99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in y around inf 60.8%
Final simplification68.2%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + (y * (1.0 - z))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((((-1.0d0) + x) * log(y)) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 90.5%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
mul-1-neg99.6%
unsub-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (<= z 1.45e+200) (- (* (+ -1.0 x) (log y)) t) (- (* y (- 1.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.45e+200) {
tmp = ((-1.0 + x) * 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 (z <= 1.45d+200) then
tmp = (((-1.0d0) + x) * 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 (z <= 1.45e+200) {
tmp = ((-1.0 + x) * Math.log(y)) - t;
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 1.45e+200: tmp = ((-1.0 + x) * math.log(y)) - t else: tmp = (y * (1.0 - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 1.45e+200) tmp = Float64(Float64(Float64(-1.0 + x) * 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 (z <= 1.45e+200) tmp = ((-1.0 + x) * log(y)) - t; else tmp = (y * (1.0 - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 1.45e+200], N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.45 \cdot 10^{+200}:\\
\;\;\;\;\left(-1 + x\right) \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if z < 1.4499999999999999e200Initial program 96.8%
Taylor expanded in y around 0 96.2%
if 1.4499999999999999e200 < z Initial program 37.0%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
mul-1-neg99.8%
unsub-neg99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 79.1%
Final simplification94.4%
(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.5%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
mul-1-neg99.6%
unsub-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 44.5%
(FPCore (x y z t) :precision binary64 (- (- t) (* z y)))
double code(double x, double y, double z, double t) {
return -t - (z * y);
}
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 - (z * y)
end function
public static double code(double x, double y, double z, double t) {
return -t - (z * y);
}
def code(x, y, z, t): return -t - (z * y)
function code(x, y, z, t) return Float64(Float64(-t) - Float64(z * y)) end
function tmp = code(x, y, z, t) tmp = -t - (z * y); end
code[x_, y_, z_, t_] := N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-t\right) - z \cdot y
\end{array}
Initial program 90.5%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
mul-1-neg99.6%
unsub-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in z around inf 44.3%
associate-*r*44.3%
mul-1-neg44.3%
Simplified44.3%
Final simplification44.3%
(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.5%
Taylor expanded in t around inf 35.6%
mul-1-neg35.6%
Simplified35.6%
herbie shell --seed 2024103
(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))