
(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)) (* (+ -1.0 x) (log y))) t))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), ((-1.0 + x) * log(y))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(Float64(-1.0 + x) * log(y))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \left(-1 + x\right) \cdot \log y\right) - t
\end{array}
Initial program 89.2%
+-commutative89.2%
fma-define89.2%
sub-neg89.2%
metadata-eval89.2%
sub-neg89.2%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (- (fma (log y) (+ -1.0 x) (* (log1p (- y)) (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return fma(log(y), (-1.0 + x), (log1p(-y) * (z + -1.0))) - t;
}
function code(x, y, z, t) return Float64(fma(log(y), Float64(-1.0 + x), Float64(log1p(Float64(-y)) * Float64(z + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision] + N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log y, -1 + x, \mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 89.2%
Taylor expanded in x around 0 89.2%
associate-+r+89.2%
distribute-rgt-out89.2%
+-commutative89.2%
fma-define89.2%
+-commutative89.2%
sub-neg89.2%
mul-1-neg89.2%
log1p-define99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (- (fma y (- 1.0 z) (* (+ -1.0 x) (log y))) t))
double code(double x, double y, double z, double t) {
return fma(y, (1.0 - z), ((-1.0 + x) * log(y))) - t;
}
function code(x, y, z, t) return Float64(fma(y, Float64(1.0 - z), Float64(Float64(-1.0 + x) * log(y))) - t) end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision] + N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 1 - z, \left(-1 + x\right) \cdot \log y\right) - t
\end{array}
Initial program 89.2%
Taylor expanded in x around 0 89.2%
associate-+r+89.2%
distribute-rgt-out89.2%
+-commutative89.2%
fma-define89.2%
+-commutative89.2%
sub-neg89.2%
mul-1-neg89.2%
log1p-define99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
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%
Simplified99.6%
Taylor expanded in y around 0 99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -1.00000005) (not (<= (+ -1.0 x) 5000000000.0))) (- (* (+ -1.0 x) (log y)) t) (- (- (- y (* z y)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -1.00000005) || !((-1.0 + x) <= 5000000000.0)) {
tmp = ((-1.0 + x) * log(y)) - t;
} else {
tmp = ((y - (z * 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 ((((-1.0d0) + x) <= (-1.00000005d0)) .or. (.not. (((-1.0d0) + x) <= 5000000000.0d0))) then
tmp = (((-1.0d0) + x) * log(y)) - t
else
tmp = ((y - (z * 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 (((-1.0 + x) <= -1.00000005) || !((-1.0 + x) <= 5000000000.0)) {
tmp = ((-1.0 + x) * Math.log(y)) - t;
} else {
tmp = ((y - (z * y)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -1.00000005) or not ((-1.0 + x) <= 5000000000.0): tmp = ((-1.0 + x) * math.log(y)) - t else: tmp = ((y - (z * y)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -1.00000005) || !(Float64(-1.0 + x) <= 5000000000.0)) tmp = Float64(Float64(Float64(-1.0 + x) * log(y)) - t); else tmp = Float64(Float64(Float64(y - Float64(z * y)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -1.00000005) || ~(((-1.0 + x) <= 5000000000.0))) tmp = ((-1.0 + x) * log(y)) - t; else tmp = ((y - (z * y)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.00000005], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], 5000000000.0]], $MachinePrecision]], N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -1.00000005 \lor \neg \left(-1 + x \leq 5000000000\right):\\
\;\;\;\;\left(-1 + x\right) \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y - z \cdot y\right) - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -1.00000004999999992 or 5e9 < (-.f64 x 1) Initial program 92.0%
+-commutative92.0%
fma-define92.0%
sub-neg92.0%
metadata-eval92.0%
sub-neg92.0%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 91.8%
if -1.00000004999999992 < (-.f64 x 1) < 5e9Initial program 86.5%
Taylor expanded in x around 0 85.6%
+-commutative85.6%
sub-neg85.6%
metadata-eval85.6%
fma-define85.6%
sub-neg85.6%
mul-1-neg85.6%
log1p-define98.7%
mul-1-neg98.7%
+-commutative98.7%
mul-1-neg98.7%
Simplified98.7%
Taylor expanded in y around 0 98.2%
mul-1-neg98.2%
log-rec98.2%
+-commutative98.2%
log-rec98.2%
unsub-neg98.2%
mul-1-neg98.2%
distribute-rgt-neg-in98.2%
sub-neg98.2%
metadata-eval98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in z around 0 98.2%
mul-1-neg98.2%
unsub-neg98.2%
Simplified98.2%
Final simplification95.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (+ -1.0 x) (log y)))) (if (or (<= t -9e+15) (not (<= t 2e-21))) (- t_1 t) (- (+ y t_1) (* z y)))))
double code(double x, double y, double z, double t) {
double t_1 = (-1.0 + x) * log(y);
double tmp;
if ((t <= -9e+15) || !(t <= 2e-21)) {
tmp = t_1 - t;
} else {
tmp = (y + t_1) - (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) :: t_1
real(8) :: tmp
t_1 = ((-1.0d0) + x) * log(y)
if ((t <= (-9d+15)) .or. (.not. (t <= 2d-21))) then
tmp = t_1 - t
else
tmp = (y + t_1) - (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (-1.0 + x) * Math.log(y);
double tmp;
if ((t <= -9e+15) || !(t <= 2e-21)) {
tmp = t_1 - t;
} else {
tmp = (y + t_1) - (z * y);
}
return tmp;
}
def code(x, y, z, t): t_1 = (-1.0 + x) * math.log(y) tmp = 0 if (t <= -9e+15) or not (t <= 2e-21): tmp = t_1 - t else: tmp = (y + t_1) - (z * y) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-1.0 + x) * log(y)) tmp = 0.0 if ((t <= -9e+15) || !(t <= 2e-21)) tmp = Float64(t_1 - t); else tmp = Float64(Float64(y + t_1) - Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (-1.0 + x) * log(y); tmp = 0.0; if ((t <= -9e+15) || ~((t <= 2e-21))) tmp = t_1 - t; else tmp = (y + t_1) - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -9e+15], N[Not[LessEqual[t, 2e-21]], $MachinePrecision]], N[(t$95$1 - t), $MachinePrecision], N[(N[(y + t$95$1), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-1 + x\right) \cdot \log y\\
\mathbf{if}\;t \leq -9 \cdot 10^{+15} \lor \neg \left(t \leq 2 \cdot 10^{-21}\right):\\
\;\;\;\;t\_1 - t\\
\mathbf{else}:\\
\;\;\;\;\left(y + t\_1\right) - z \cdot y\\
\end{array}
\end{array}
if t < -9e15 or 1.99999999999999982e-21 < t Initial program 97.7%
+-commutative97.7%
fma-define97.7%
sub-neg97.7%
metadata-eval97.7%
sub-neg97.7%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 97.6%
if -9e15 < t < 1.99999999999999982e-21Initial program 81.3%
Taylor expanded in x around 0 81.3%
associate-+r+81.3%
distribute-rgt-out81.3%
+-commutative81.3%
fma-define81.3%
+-commutative81.3%
sub-neg81.3%
mul-1-neg81.3%
log1p-define99.8%
mul-1-neg99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 99.3%
mul-1-neg99.3%
distribute-rgt-neg-in99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in z around 0 99.3%
mul-1-neg55.6%
unsub-neg55.6%
Simplified99.3%
Taylor expanded in t around 0 98.5%
Final simplification98.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (+ -1.0 x) (log y))))
(if (<= t -9e+15)
(- (/ 1.0 (/ 1.0 t_1)) t)
(if (<= t 1e-21) (- (+ y t_1) (* z 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 (t <= -9e+15) {
tmp = (1.0 / (1.0 / t_1)) - t;
} else if (t <= 1e-21) {
tmp = (y + t_1) - (z * y);
} else {
tmp = 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 (t <= (-9d+15)) then
tmp = (1.0d0 / (1.0d0 / t_1)) - t
else if (t <= 1d-21) then
tmp = (y + t_1) - (z * y)
else
tmp = 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 (t <= -9e+15) {
tmp = (1.0 / (1.0 / t_1)) - t;
} else if (t <= 1e-21) {
tmp = (y + t_1) - (z * y);
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (-1.0 + x) * math.log(y) tmp = 0 if t <= -9e+15: tmp = (1.0 / (1.0 / t_1)) - t elif t <= 1e-21: tmp = (y + t_1) - (z * y) else: tmp = t_1 - t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-1.0 + x) * log(y)) tmp = 0.0 if (t <= -9e+15) tmp = Float64(Float64(1.0 / Float64(1.0 / t_1)) - t); elseif (t <= 1e-21) tmp = Float64(Float64(y + t_1) - Float64(z * y)); else tmp = Float64(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 (t <= -9e+15) tmp = (1.0 / (1.0 / t_1)) - t; elseif (t <= 1e-21) tmp = (y + t_1) - (z * y); else tmp = 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[t, -9e+15], N[(N[(1.0 / N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 1e-21], N[(N[(y + t$95$1), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-1 + x\right) \cdot \log y\\
\mathbf{if}\;t \leq -9 \cdot 10^{+15}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_1}} - t\\
\mathbf{elif}\;t \leq 10^{-21}:\\
\;\;\;\;\left(y + t\_1\right) - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < -9e15Initial program 99.1%
+-commutative99.1%
fma-define99.1%
sub-neg99.1%
metadata-eval99.1%
sub-neg99.1%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
*-commutative99.1%
+-commutative99.1%
metadata-eval99.1%
sub-neg99.1%
flip--72.9%
metadata-eval72.9%
fma-neg72.9%
metadata-eval72.9%
+-commutative72.9%
associate-/r/72.9%
clear-num72.9%
clear-num72.9%
associate-/r/72.9%
metadata-eval72.9%
fma-neg72.9%
metadata-eval72.9%
+-commutative72.9%
flip--99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
*-commutative99.1%
Applied egg-rr99.1%
if -9e15 < t < 9.99999999999999908e-22Initial program 81.3%
Taylor expanded in x around 0 81.3%
associate-+r+81.3%
distribute-rgt-out81.3%
+-commutative81.3%
fma-define81.3%
+-commutative81.3%
sub-neg81.3%
mul-1-neg81.3%
log1p-define99.8%
mul-1-neg99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 99.3%
mul-1-neg99.3%
distribute-rgt-neg-in99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in z around 0 99.3%
mul-1-neg55.6%
unsub-neg55.6%
Simplified99.3%
Taylor expanded in t around 0 98.5%
if 9.99999999999999908e-22 < t Initial program 96.6%
+-commutative96.6%
fma-define96.6%
sub-neg96.6%
metadata-eval96.6%
sub-neg96.6%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 96.3%
Final simplification98.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.0) (not (<= x 4.35e-13))) (- (* x (log y)) t) (- (- (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.0) || !(x <= 4.35e-13)) {
tmp = (x * log(y)) - t;
} else {
tmp = -log(y) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.0d0)) .or. (.not. (x <= 4.35d-13))) then
tmp = (x * log(y)) - t
else
tmp = -log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.0) || !(x <= 4.35e-13)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = -Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.0) or not (x <= 4.35e-13): tmp = (x * math.log(y)) - t else: tmp = -math.log(y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.0) || !(x <= 4.35e-13)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(-log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.0) || ~((x <= 4.35e-13))) tmp = (x * log(y)) - t; else tmp = -log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 4.35e-13]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 4.35 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\
\end{array}
\end{array}
if x < -1 or 4.35000000000000014e-13 < x Initial program 90.9%
Taylor expanded in x around 0 90.8%
associate-+r+90.8%
distribute-rgt-out90.9%
+-commutative90.9%
fma-define90.9%
+-commutative90.9%
sub-neg90.9%
mul-1-neg90.9%
log1p-define99.8%
mul-1-neg99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 89.7%
*-commutative89.7%
Simplified89.7%
if -1 < x < 4.35000000000000014e-13Initial program 87.5%
+-commutative87.5%
fma-define87.5%
sub-neg87.5%
metadata-eval87.5%
sub-neg87.5%
log1p-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 86.7%
Taylor expanded in x around 0 86.4%
mul-1-neg86.4%
Simplified86.4%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.0) (not (<= x 4.35e-13))) (- (* x (log y)) t) (- (- y (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.0) || !(x <= 4.35e-13)) {
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 <= (-1.0d0)) .or. (.not. (x <= 4.35d-13))) 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 <= -1.0) || !(x <= 4.35e-13)) {
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 <= -1.0) or not (x <= 4.35e-13): 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 <= -1.0) || !(x <= 4.35e-13)) 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 <= -1.0) || ~((x <= 4.35e-13))) 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, -1.0], N[Not[LessEqual[x, 4.35e-13]], $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 -1 \lor \neg \left(x \leq 4.35 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\end{array}
\end{array}
if x < -1 or 4.35000000000000014e-13 < x Initial program 90.9%
Taylor expanded in x around 0 90.8%
associate-+r+90.8%
distribute-rgt-out90.9%
+-commutative90.9%
fma-define90.9%
+-commutative90.9%
sub-neg90.9%
mul-1-neg90.9%
log1p-define99.8%
mul-1-neg99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 89.7%
*-commutative89.7%
Simplified89.7%
if -1 < x < 4.35000000000000014e-13Initial program 87.5%
Taylor expanded in x around 0 87.1%
+-commutative87.1%
sub-neg87.1%
metadata-eval87.1%
fma-define87.1%
sub-neg87.1%
mul-1-neg87.1%
log1p-define99.6%
mul-1-neg99.6%
+-commutative99.6%
mul-1-neg99.6%
Simplified99.6%
Taylor expanded in y around 0 99.1%
mul-1-neg99.1%
log-rec99.1%
+-commutative99.1%
log-rec99.1%
unsub-neg99.1%
mul-1-neg99.1%
distribute-rgt-neg-in99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in z around 0 86.5%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4e+129) (not (<= z 6.2e+178))) (- (- t) (* z y)) (- (- (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4e+129) || !(z <= 6.2e+178)) {
tmp = -t - (z * y);
} else {
tmp = -log(y) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4d+129)) .or. (.not. (z <= 6.2d+178))) then
tmp = -t - (z * y)
else
tmp = -log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4e+129) || !(z <= 6.2e+178)) {
tmp = -t - (z * y);
} else {
tmp = -Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4e+129) or not (z <= 6.2e+178): tmp = -t - (z * y) else: tmp = -math.log(y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4e+129) || !(z <= 6.2e+178)) tmp = Float64(Float64(-t) - Float64(z * y)); else tmp = Float64(Float64(-log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4e+129) || ~((z <= 6.2e+178))) tmp = -t - (z * y); else tmp = -log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4e+129], N[Not[LessEqual[z, 6.2e+178]], $MachinePrecision]], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+129} \lor \neg \left(z \leq 6.2 \cdot 10^{+178}\right):\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\
\end{array}
\end{array}
if z < -4e129 or 6.19999999999999982e178 < z Initial program 63.0%
Taylor expanded in x around 0 63.0%
associate-+r+63.0%
distribute-rgt-out63.0%
+-commutative63.0%
fma-define63.0%
+-commutative63.0%
sub-neg63.0%
mul-1-neg63.0%
log1p-define99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 63.4%
mul-1-neg63.4%
distribute-rgt-neg-in63.4%
Simplified63.4%
if -4e129 < z < 6.19999999999999982e178Initial program 98.5%
+-commutative98.5%
fma-define98.5%
sub-neg98.5%
metadata-eval98.5%
sub-neg98.5%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 98.0%
Taylor expanded in x around 0 64.7%
mul-1-neg64.7%
Simplified64.7%
Final simplification64.3%
(FPCore (x y z t) :precision binary64 (- (- (* (+ -1.0 x) (log y)) (* y (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) - (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 = ((((-1.0d0) + x) * log(y)) - (y * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) - (y * (z + -1.0))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) - (y * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) - Float64(y * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) - (y * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y - y \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 89.2%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
*-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7.6e-19) (not (<= t 3.2e-7))) (- (- t) (* z y)) (- (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.6e-19) || !(t <= 3.2e-7)) {
tmp = -t - (z * y);
} else {
tmp = -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 ((t <= (-7.6d-19)) .or. (.not. (t <= 3.2d-7))) then
tmp = -t - (z * y)
else
tmp = -log(y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.6e-19) || !(t <= 3.2e-7)) {
tmp = -t - (z * y);
} else {
tmp = -Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7.6e-19) or not (t <= 3.2e-7): tmp = -t - (z * y) else: tmp = -math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7.6e-19) || !(t <= 3.2e-7)) tmp = Float64(Float64(-t) - Float64(z * y)); else tmp = Float64(-log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -7.6e-19) || ~((t <= 3.2e-7))) tmp = -t - (z * y); else tmp = -log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7.6e-19], N[Not[LessEqual[t, 3.2e-7]], $MachinePrecision]], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision], (-N[Log[y], $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.6 \cdot 10^{-19} \lor \neg \left(t \leq 3.2 \cdot 10^{-7}\right):\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;-\log y\\
\end{array}
\end{array}
if t < -7.6e-19 or 3.2000000000000001e-7 < t Initial program 94.8%
Taylor expanded in x around 0 94.8%
associate-+r+94.8%
distribute-rgt-out94.8%
+-commutative94.8%
fma-define94.8%
+-commutative94.8%
sub-neg94.8%
mul-1-neg94.8%
log1p-define99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 77.1%
mul-1-neg77.1%
distribute-rgt-neg-in77.1%
Simplified77.1%
if -7.6e-19 < t < 3.2000000000000001e-7Initial program 83.5%
+-commutative83.5%
fma-define83.5%
sub-neg83.5%
metadata-eval83.5%
sub-neg83.5%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 82.8%
Taylor expanded in x around 0 38.3%
mul-1-neg38.3%
Simplified38.3%
Taylor expanded in t around 0 38.3%
mul-1-neg38.3%
Simplified38.3%
Final simplification57.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1.5e+218) (- (- t) (* z y)) (- (* (+ -1.0 x) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e+218) {
tmp = -t - (z * y);
} else {
tmp = ((-1.0 + 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 (z <= (-1.5d+218)) then
tmp = -t - (z * y)
else
tmp = (((-1.0d0) + 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 (z <= -1.5e+218) {
tmp = -t - (z * y);
} else {
tmp = ((-1.0 + x) * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.5e+218: tmp = -t - (z * y) else: tmp = ((-1.0 + x) * math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.5e+218) tmp = Float64(Float64(-t) - Float64(z * y)); else tmp = Float64(Float64(Float64(-1.0 + x) * log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.5e+218) tmp = -t - (z * y); else tmp = ((-1.0 + x) * log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.5e+218], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+218}:\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(-1 + x\right) \cdot \log y - t\\
\end{array}
\end{array}
if z < -1.5e218Initial program 51.9%
Taylor expanded in x around 0 51.9%
associate-+r+51.9%
distribute-rgt-out51.9%
+-commutative51.9%
fma-define51.9%
+-commutative51.9%
sub-neg51.9%
mul-1-neg51.9%
log1p-define100.0%
mul-1-neg100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 79.3%
mul-1-neg79.3%
distribute-rgt-neg-in79.3%
Simplified79.3%
if -1.5e218 < z Initial program 91.7%
+-commutative91.7%
fma-define91.7%
sub-neg91.7%
metadata-eval91.7%
sub-neg91.7%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 91.2%
Final simplification90.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9e+15) (not (<= t 0.0014))) (- t) (* y (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9e+15) || !(t <= 0.0014)) {
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 <= (-9d+15)) .or. (.not. (t <= 0.0014d0))) 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 <= -9e+15) || !(t <= 0.0014)) {
tmp = -t;
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9e+15) or not (t <= 0.0014): tmp = -t else: tmp = y * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9e+15) || !(t <= 0.0014)) 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 <= -9e+15) || ~((t <= 0.0014))) tmp = -t; else tmp = y * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9e+15], N[Not[LessEqual[t, 0.0014]], $MachinePrecision]], (-t), N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+15} \lor \neg \left(t \leq 0.0014\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if t < -9e15 or 0.00139999999999999999 < t Initial program 97.7%
+-commutative97.7%
fma-define97.7%
sub-neg97.7%
metadata-eval97.7%
sub-neg97.7%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 76.7%
mul-1-neg76.7%
Simplified76.7%
if -9e15 < t < 0.00139999999999999999Initial program 81.6%
Taylor expanded in x around 0 81.6%
associate-+r+81.6%
distribute-rgt-out81.6%
+-commutative81.6%
fma-define81.6%
+-commutative81.6%
sub-neg81.6%
mul-1-neg81.6%
log1p-define99.8%
mul-1-neg99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
distribute-rgt-neg-in99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around 0 99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 20.1%
Final simplification46.8%
(FPCore (x y z t) :precision binary64 (if (<= t -1.25e+16) (- (* z y) t) (if (<= t 0.0014) (* y (- 1.0 z)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.25e+16) {
tmp = (z * y) - t;
} else if (t <= 0.0014) {
tmp = y * (1.0 - z);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.25d+16)) then
tmp = (z * y) - t
else if (t <= 0.0014d0) then
tmp = y * (1.0d0 - z)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.25e+16) {
tmp = (z * y) - t;
} else if (t <= 0.0014) {
tmp = y * (1.0 - z);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.25e+16: tmp = (z * y) - t elif t <= 0.0014: tmp = y * (1.0 - z) else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.25e+16) tmp = Float64(Float64(z * y) - t); elseif (t <= 0.0014) tmp = Float64(y * Float64(1.0 - z)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.25e+16) tmp = (z * y) - t; elseif (t <= 0.0014) tmp = y * (1.0 - z); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.25e+16], N[(N[(z * y), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 0.0014], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+16}:\\
\;\;\;\;z \cdot y - t\\
\mathbf{elif}\;t \leq 0.0014:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -1.25e16Initial program 99.1%
Taylor expanded in x around 0 99.1%
associate-+r+99.1%
distribute-rgt-out99.1%
+-commutative99.1%
fma-define99.1%
+-commutative99.1%
sub-neg99.1%
mul-1-neg99.1%
log1p-define99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 79.3%
mul-1-neg79.3%
distribute-rgt-neg-in79.3%
Simplified79.3%
sub-neg79.3%
add-sqr-sqrt41.1%
sqrt-unprod61.2%
sqr-neg61.2%
sqrt-unprod38.4%
add-sqr-sqrt79.4%
Applied egg-rr79.4%
sub-neg79.4%
Simplified79.4%
if -1.25e16 < t < 0.00139999999999999999Initial program 81.6%
Taylor expanded in x around 0 81.6%
associate-+r+81.6%
distribute-rgt-out81.6%
+-commutative81.6%
fma-define81.6%
+-commutative81.6%
sub-neg81.6%
mul-1-neg81.6%
log1p-define99.8%
mul-1-neg99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
distribute-rgt-neg-in99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around 0 99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 20.1%
if 0.00139999999999999999 < t Initial program 96.5%
+-commutative96.5%
fma-define96.5%
sub-neg96.5%
metadata-eval96.5%
sub-neg96.5%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 74.3%
mul-1-neg74.3%
Simplified74.3%
Final simplification46.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9e+15) (not (<= t 0.00106))) (- t) (* z (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9e+15) || !(t <= 0.00106)) {
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 <= (-9d+15)) .or. (.not. (t <= 0.00106d0))) 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 <= -9e+15) || !(t <= 0.00106)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9e+15) or not (t <= 0.00106): tmp = -t else: tmp = z * -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9e+15) || !(t <= 0.00106)) 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 <= -9e+15) || ~((t <= 0.00106))) tmp = -t; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9e+15], N[Not[LessEqual[t, 0.00106]], $MachinePrecision]], (-t), N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+15} \lor \neg \left(t \leq 0.00106\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < -9e15 or 0.00105999999999999996 < t Initial program 97.7%
+-commutative97.7%
fma-define97.7%
sub-neg97.7%
metadata-eval97.7%
sub-neg97.7%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 76.7%
mul-1-neg76.7%
Simplified76.7%
if -9e15 < t < 0.00105999999999999996Initial program 81.6%
Taylor expanded in x around 0 81.6%
associate-+r+81.6%
distribute-rgt-out81.6%
+-commutative81.6%
fma-define81.6%
+-commutative81.6%
sub-neg81.6%
mul-1-neg81.6%
log1p-define99.8%
mul-1-neg99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
distribute-rgt-neg-in99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around 0 99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around inf 19.6%
associate-*r*19.6%
neg-mul-119.6%
Simplified19.6%
Final simplification46.6%
(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.2%
Taylor expanded in x around 0 89.2%
associate-+r+89.2%
distribute-rgt-out89.2%
+-commutative89.2%
fma-define89.2%
+-commutative89.2%
sub-neg89.2%
mul-1-neg89.2%
log1p-define99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
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%
Simplified99.6%
Taylor expanded in y around inf 47.9%
Final simplification47.9%
(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 89.2%
Taylor expanded in x around 0 89.2%
associate-+r+89.2%
distribute-rgt-out89.2%
+-commutative89.2%
fma-define89.2%
+-commutative89.2%
sub-neg89.2%
mul-1-neg89.2%
log1p-define99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
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%
Simplified99.6%
Taylor expanded in z around inf 47.7%
mul-1-neg47.7%
distribute-rgt-neg-in47.7%
Simplified47.7%
Final simplification47.7%
(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.2%
+-commutative89.2%
fma-define89.2%
sub-neg89.2%
metadata-eval89.2%
sub-neg89.2%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 37.9%
mul-1-neg37.9%
Simplified37.9%
Final simplification37.9%
herbie shell --seed 2024034
(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))