
(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 15 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 (- (* (log1p (- y)) (+ z -1.0)) (fma (log y) (- 1.0 x) t)))
double code(double x, double y, double z, double t) {
return (log1p(-y) * (z + -1.0)) - fma(log(y), (1.0 - x), t);
}
function code(x, y, z, t) return Float64(Float64(log1p(Float64(-y)) * Float64(z + -1.0)) - fma(log(y), Float64(1.0 - x), t)) end
code[x_, y_, z_, t_] := N[(N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * N[(1.0 - x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)
\end{array}
Initial program 91.3%
associate--l+91.3%
+-commutative91.3%
associate-+l-91.3%
*-commutative91.3%
*-commutative91.3%
sub-neg91.3%
metadata-eval91.3%
sub-neg91.3%
log1p-def99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (* y (- 1.0 z)) (fma (log y) (- 1.0 x) t)))
double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) - fma(log(y), (1.0 - x), t);
}
function code(x, y, z, t) return Float64(Float64(y * Float64(1.0 - z)) - fma(log(y), Float64(1.0 - x), t)) end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * N[(1.0 - x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(1 - z\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)
\end{array}
Initial program 91.3%
associate--l+91.3%
+-commutative91.3%
associate-+l-91.3%
*-commutative91.3%
*-commutative91.3%
sub-neg91.3%
metadata-eval91.3%
sub-neg91.3%
log1p-def99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 99.5%
associate-*r*99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
neg-mul-199.5%
unsub-neg99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -500.0)
(- (* (log y) (+ -1.0 x)) t)
(if (<= (+ -1.0 x) 4e+15)
(- (- (* y (- 1.0 z)) (log y)) t)
(- (* (log y) x) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -500.0) {
tmp = (log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 4e+15) {
tmp = ((y * (1.0 - z)) - log(y)) - t;
} else {
tmp = (log(y) * x) - 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) <= (-500.0d0)) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else if (((-1.0d0) + x) <= 4d+15) then
tmp = ((y * (1.0d0 - z)) - log(y)) - t
else
tmp = (log(y) * x) - 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) <= -500.0) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 4e+15) {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
} else {
tmp = (Math.log(y) * x) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -500.0: tmp = (math.log(y) * (-1.0 + x)) - t elif (-1.0 + x) <= 4e+15: tmp = ((y * (1.0 - z)) - math.log(y)) - t else: tmp = (math.log(y) * x) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -500.0) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); elseif (Float64(-1.0 + x) <= 4e+15) tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); else tmp = Float64(Float64(log(y) * x) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -500.0) tmp = (log(y) * (-1.0 + x)) - t; elseif ((-1.0 + x) <= 4e+15) tmp = ((y * (1.0 - z)) - log(y)) - t; else tmp = (log(y) * x) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -500.0], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 4e+15], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -500:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{elif}\;-1 + x \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot x - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -500Initial program 94.8%
Taylor expanded in y around 0 94.0%
if -500 < (-.f64 x 1) < 4e15Initial program 86.0%
Taylor expanded in x around 0 85.3%
mul-1-neg85.3%
unsub-neg85.3%
*-commutative85.3%
sub-neg85.3%
metadata-eval85.3%
sub-neg85.3%
mul-1-neg85.3%
log1p-def99.2%
mul-1-neg99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in y around 0 98.9%
neg-mul-198.9%
unsub-neg98.9%
associate-*r*98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
distribute-lft-in98.9%
metadata-eval98.9%
neg-mul-198.9%
sub-neg98.9%
*-commutative98.9%
Simplified98.9%
if 4e15 < (-.f64 x 1) Initial program 99.6%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around inf 99.6%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log y))) (t_2 (* (log y) x)) (t_3 (- (* y (- 1.0 z)) t)))
(if (<= x -65000000000000.0)
t_2
(if (<= x -1.35e-216)
t_3
(if (<= x -1.9e-295)
t_1
(if (<= x 2.2e-140)
t_3
(if (<= x 1.8e-98) t_1 (if (<= x 1.8e+21) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = -log(y);
double t_2 = log(y) * x;
double t_3 = (y * (1.0 - z)) - t;
double tmp;
if (x <= -65000000000000.0) {
tmp = t_2;
} else if (x <= -1.35e-216) {
tmp = t_3;
} else if (x <= -1.9e-295) {
tmp = t_1;
} else if (x <= 2.2e-140) {
tmp = t_3;
} else if (x <= 1.8e-98) {
tmp = t_1;
} else if (x <= 1.8e+21) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = -log(y)
t_2 = log(y) * x
t_3 = (y * (1.0d0 - z)) - t
if (x <= (-65000000000000.0d0)) then
tmp = t_2
else if (x <= (-1.35d-216)) then
tmp = t_3
else if (x <= (-1.9d-295)) then
tmp = t_1
else if (x <= 2.2d-140) then
tmp = t_3
else if (x <= 1.8d-98) then
tmp = t_1
else if (x <= 1.8d+21) then
tmp = t_3
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);
double t_2 = Math.log(y) * x;
double t_3 = (y * (1.0 - z)) - t;
double tmp;
if (x <= -65000000000000.0) {
tmp = t_2;
} else if (x <= -1.35e-216) {
tmp = t_3;
} else if (x <= -1.9e-295) {
tmp = t_1;
} else if (x <= 2.2e-140) {
tmp = t_3;
} else if (x <= 1.8e-98) {
tmp = t_1;
} else if (x <= 1.8e+21) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = -math.log(y) t_2 = math.log(y) * x t_3 = (y * (1.0 - z)) - t tmp = 0 if x <= -65000000000000.0: tmp = t_2 elif x <= -1.35e-216: tmp = t_3 elif x <= -1.9e-295: tmp = t_1 elif x <= 2.2e-140: tmp = t_3 elif x <= 1.8e-98: tmp = t_1 elif x <= 1.8e+21: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(-log(y)) t_2 = Float64(log(y) * x) t_3 = Float64(Float64(y * Float64(1.0 - z)) - t) tmp = 0.0 if (x <= -65000000000000.0) tmp = t_2; elseif (x <= -1.35e-216) tmp = t_3; elseif (x <= -1.9e-295) tmp = t_1; elseif (x <= 2.2e-140) tmp = t_3; elseif (x <= 1.8e-98) tmp = t_1; elseif (x <= 1.8e+21) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -log(y); t_2 = log(y) * x; t_3 = (y * (1.0 - z)) - t; tmp = 0.0; if (x <= -65000000000000.0) tmp = t_2; elseif (x <= -1.35e-216) tmp = t_3; elseif (x <= -1.9e-295) tmp = t_1; elseif (x <= 2.2e-140) tmp = t_3; elseif (x <= 1.8e-98) tmp = t_1; elseif (x <= 1.8e+21) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = (-N[Log[y], $MachinePrecision])}, Block[{t$95$2 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -65000000000000.0], t$95$2, If[LessEqual[x, -1.35e-216], t$95$3, If[LessEqual[x, -1.9e-295], t$95$1, If[LessEqual[x, 2.2e-140], t$95$3, If[LessEqual[x, 1.8e-98], t$95$1, If[LessEqual[x, 1.8e+21], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\log y\\
t_2 := \log y \cdot x\\
t_3 := y \cdot \left(1 - z\right) - t\\
\mathbf{if}\;x \leq -65000000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-216}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-295}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-140}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+21}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -6.5e13 or 1.8e21 < x Initial program 96.7%
Taylor expanded in y around 0 96.2%
Taylor expanded in x around inf 79.6%
if -6.5e13 < x < -1.35e-216 or -1.90000000000000009e-295 < x < 2.1999999999999999e-140 or 1.8000000000000001e-98 < x < 1.8e21Initial program 85.5%
associate--l+85.5%
+-commutative85.5%
associate-+l-85.5%
*-commutative85.5%
*-commutative85.5%
sub-neg85.5%
metadata-eval85.5%
sub-neg85.5%
log1p-def100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-def100.0%
neg-sub0100.0%
associate--r-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
associate-*r*100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 70.1%
if -1.35e-216 < x < -1.90000000000000009e-295 or 2.1999999999999999e-140 < x < 1.8000000000000001e-98Initial program 91.4%
Taylor expanded in x around 0 91.4%
mul-1-neg91.4%
unsub-neg91.4%
*-commutative91.4%
sub-neg91.4%
metadata-eval91.4%
sub-neg91.4%
mul-1-neg91.4%
log1p-def100.0%
mul-1-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 88.6%
neg-mul-188.6%
Simplified88.6%
Taylor expanded in t around 0 75.9%
mul-1-neg75.9%
Simplified75.9%
Final simplification75.1%
(FPCore (x y z t) :precision binary64 (if (<= (+ -1.0 x) -4000.0) (* (log y) (+ -1.0 x)) (if (<= (+ -1.0 x) 1e+17) (- y (+ (log y) t)) (* (log y) x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -4000.0) {
tmp = log(y) * (-1.0 + x);
} else if ((-1.0 + x) <= 1e+17) {
tmp = y - (log(y) + t);
} else {
tmp = log(y) * x;
}
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) <= (-4000.0d0)) then
tmp = log(y) * ((-1.0d0) + x)
else if (((-1.0d0) + x) <= 1d+17) then
tmp = y - (log(y) + t)
else
tmp = log(y) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -4000.0) {
tmp = Math.log(y) * (-1.0 + x);
} else if ((-1.0 + x) <= 1e+17) {
tmp = y - (Math.log(y) + t);
} else {
tmp = Math.log(y) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -4000.0: tmp = math.log(y) * (-1.0 + x) elif (-1.0 + x) <= 1e+17: tmp = y - (math.log(y) + t) else: tmp = math.log(y) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -4000.0) tmp = Float64(log(y) * Float64(-1.0 + x)); elseif (Float64(-1.0 + x) <= 1e+17) tmp = Float64(y - Float64(log(y) + t)); else tmp = Float64(log(y) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -4000.0) tmp = log(y) * (-1.0 + x); elseif ((-1.0 + x) <= 1e+17) tmp = y - (log(y) + t); else tmp = log(y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -4000.0], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 1e+17], N[(y - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -4000:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\mathbf{elif}\;-1 + x \leq 10^{+17}:\\
\;\;\;\;y - \left(\log y + t\right)\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot x\\
\end{array}
\end{array}
if (-.f64 x 1) < -4e3Initial program 94.7%
Taylor expanded in y around 0 93.9%
Taylor expanded in t around 0 79.1%
if -4e3 < (-.f64 x 1) < 1e17Initial program 86.2%
Taylor expanded in x around 0 85.1%
mul-1-neg85.1%
unsub-neg85.1%
*-commutative85.1%
sub-neg85.1%
metadata-eval85.1%
sub-neg85.1%
mul-1-neg85.1%
log1p-def98.8%
mul-1-neg98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in z around 0 85.1%
mul-1-neg85.1%
sub-neg85.1%
log1p-def85.1%
Simplified85.1%
Taylor expanded in y around 0 84.7%
mul-1-neg84.7%
+-commutative84.7%
unsub-neg84.7%
Simplified84.7%
if 1e17 < (-.f64 x 1) Initial program 99.6%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around inf 80.1%
Final simplification82.2%
(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 91.3%
Taylor expanded in y around 0 99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
*-commutative99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)) (t_2 (- (- t) (log y))))
(if (<= x -20000000000000.0)
t_1
(if (<= x 2.35e-172)
t_2
(if (<= x 4.1e-142)
(- (* y (- 1.0 z)) t)
(if (<= x 2.8e+19) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double t_2 = -t - log(y);
double tmp;
if (x <= -20000000000000.0) {
tmp = t_1;
} else if (x <= 2.35e-172) {
tmp = t_2;
} else if (x <= 4.1e-142) {
tmp = (y * (1.0 - z)) - t;
} else if (x <= 2.8e+19) {
tmp = t_2;
} else {
tmp = t_1;
}
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) * x
t_2 = -t - log(y)
if (x <= (-20000000000000.0d0)) then
tmp = t_1
else if (x <= 2.35d-172) then
tmp = t_2
else if (x <= 4.1d-142) then
tmp = (y * (1.0d0 - z)) - t
else if (x <= 2.8d+19) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(y) * x;
double t_2 = -t - Math.log(y);
double tmp;
if (x <= -20000000000000.0) {
tmp = t_1;
} else if (x <= 2.35e-172) {
tmp = t_2;
} else if (x <= 4.1e-142) {
tmp = (y * (1.0 - z)) - t;
} else if (x <= 2.8e+19) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x t_2 = -t - math.log(y) tmp = 0 if x <= -20000000000000.0: tmp = t_1 elif x <= 2.35e-172: tmp = t_2 elif x <= 4.1e-142: tmp = (y * (1.0 - z)) - t elif x <= 2.8e+19: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(-t) - log(y)) tmp = 0.0 if (x <= -20000000000000.0) tmp = t_1; elseif (x <= 2.35e-172) tmp = t_2; elseif (x <= 4.1e-142) tmp = Float64(Float64(y * Float64(1.0 - z)) - t); elseif (x <= 2.8e+19) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; t_2 = -t - log(y); tmp = 0.0; if (x <= -20000000000000.0) tmp = t_1; elseif (x <= 2.35e-172) tmp = t_2; elseif (x <= 4.1e-142) tmp = (y * (1.0 - z)) - t; elseif (x <= 2.8e+19) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -20000000000000.0], t$95$1, If[LessEqual[x, 2.35e-172], t$95$2, If[LessEqual[x, 4.1e-142], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 2.8e+19], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := \left(-t\right) - \log y\\
\mathbf{if}\;x \leq -20000000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{-172}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-142}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+19}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2e13 or 2.8e19 < x Initial program 96.7%
Taylor expanded in y around 0 96.2%
Taylor expanded in x around inf 79.6%
if -2e13 < x < 2.34999999999999988e-172 or 4.1e-142 < x < 2.8e19Initial program 89.5%
Taylor expanded in x around 0 86.9%
mul-1-neg86.9%
unsub-neg86.9%
*-commutative86.9%
sub-neg86.9%
metadata-eval86.9%
sub-neg86.9%
mul-1-neg86.9%
log1p-def97.3%
mul-1-neg97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in y around 0 86.4%
neg-mul-186.4%
Simplified86.4%
if 2.34999999999999988e-172 < x < 4.1e-142Initial program 52.9%
associate--l+52.9%
+-commutative52.9%
associate-+l-52.9%
*-commutative52.9%
*-commutative52.9%
sub-neg52.9%
metadata-eval52.9%
sub-neg52.9%
log1p-def100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-def100.0%
neg-sub0100.0%
associate--r-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
associate-*r*100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
Final simplification83.8%
(FPCore (x y z t) :precision binary64 (if (<= (+ -1.0 x) -4000.0) (* (log y) (+ -1.0 x)) (if (<= (+ -1.0 x) 1e+17) (- (- t) (log y)) (* (log y) x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -4000.0) {
tmp = log(y) * (-1.0 + x);
} else if ((-1.0 + x) <= 1e+17) {
tmp = -t - log(y);
} else {
tmp = log(y) * x;
}
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) <= (-4000.0d0)) then
tmp = log(y) * ((-1.0d0) + x)
else if (((-1.0d0) + x) <= 1d+17) then
tmp = -t - log(y)
else
tmp = log(y) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -4000.0) {
tmp = Math.log(y) * (-1.0 + x);
} else if ((-1.0 + x) <= 1e+17) {
tmp = -t - Math.log(y);
} else {
tmp = Math.log(y) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -4000.0: tmp = math.log(y) * (-1.0 + x) elif (-1.0 + x) <= 1e+17: tmp = -t - math.log(y) else: tmp = math.log(y) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -4000.0) tmp = Float64(log(y) * Float64(-1.0 + x)); elseif (Float64(-1.0 + x) <= 1e+17) tmp = Float64(Float64(-t) - log(y)); else tmp = Float64(log(y) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -4000.0) tmp = log(y) * (-1.0 + x); elseif ((-1.0 + x) <= 1e+17) tmp = -t - log(y); else tmp = log(y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -4000.0], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 1e+17], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -4000:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\mathbf{elif}\;-1 + x \leq 10^{+17}:\\
\;\;\;\;\left(-t\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot x\\
\end{array}
\end{array}
if (-.f64 x 1) < -4e3Initial program 94.7%
Taylor expanded in y around 0 93.9%
Taylor expanded in t around 0 79.1%
if -4e3 < (-.f64 x 1) < 1e17Initial program 86.2%
Taylor expanded in x around 0 85.1%
mul-1-neg85.1%
unsub-neg85.1%
*-commutative85.1%
sub-neg85.1%
metadata-eval85.1%
sub-neg85.1%
mul-1-neg85.1%
log1p-def98.8%
mul-1-neg98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in y around 0 84.6%
neg-mul-184.6%
Simplified84.6%
if 1e17 < (-.f64 x 1) Initial program 99.6%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around inf 80.1%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -14000.0) (not (<= t 320.0))) (- (* (log y) x) t) (* (log y) (+ -1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -14000.0) || !(t <= 320.0)) {
tmp = (log(y) * x) - t;
} else {
tmp = log(y) * (-1.0 + x);
}
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 <= (-14000.0d0)) .or. (.not. (t <= 320.0d0))) then
tmp = (log(y) * x) - t
else
tmp = log(y) * ((-1.0d0) + x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -14000.0) || !(t <= 320.0)) {
tmp = (Math.log(y) * x) - t;
} else {
tmp = Math.log(y) * (-1.0 + x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -14000.0) or not (t <= 320.0): tmp = (math.log(y) * x) - t else: tmp = math.log(y) * (-1.0 + x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -14000.0) || !(t <= 320.0)) tmp = Float64(Float64(log(y) * x) - t); else tmp = Float64(log(y) * Float64(-1.0 + x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -14000.0) || ~((t <= 320.0))) tmp = (log(y) * x) - t; else tmp = log(y) * (-1.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -14000.0], N[Not[LessEqual[t, 320.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -14000 \lor \neg \left(t \leq 320\right):\\
\;\;\;\;\log y \cdot x - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\end{array}
\end{array}
if t < -14000 or 320 < t Initial program 94.8%
Taylor expanded in y around 0 94.8%
Taylor expanded in x around inf 93.3%
if -14000 < t < 320Initial program 88.0%
Taylor expanded in y around 0 87.0%
Taylor expanded in t around 0 87.0%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (- (* (log y) (+ -1.0 x)) t))
double code(double x, double y, double z, double t) {
return (log(y) * (-1.0 + x)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (log(y) * ((-1.0d0) + x)) - t
end function
public static double code(double x, double y, double z, double t) {
return (Math.log(y) * (-1.0 + x)) - t;
}
def code(x, y, z, t): return (math.log(y) * (-1.0 + x)) - t
function code(x, y, z, t) return Float64(Float64(log(y) * Float64(-1.0 + x)) - t) end
function tmp = code(x, y, z, t) tmp = (log(y) * (-1.0 + x)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log y \cdot \left(-1 + x\right) - t
\end{array}
Initial program 91.3%
Taylor expanded in y around 0 90.9%
Final simplification90.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.05e-53) (not (<= t 3.5e-33))) (- (* y (- 1.0 z)) t) (- (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.05e-53) || !(t <= 3.5e-33)) {
tmp = (y * (1.0 - z)) - t;
} 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 <= (-1.05d-53)) .or. (.not. (t <= 3.5d-33))) then
tmp = (y * (1.0d0 - z)) - t
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 <= -1.05e-53) || !(t <= 3.5e-33)) {
tmp = (y * (1.0 - z)) - t;
} else {
tmp = -Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.05e-53) or not (t <= 3.5e-33): tmp = (y * (1.0 - z)) - t else: tmp = -math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.05e-53) || !(t <= 3.5e-33)) tmp = Float64(Float64(y * Float64(1.0 - z)) - t); else tmp = Float64(-log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.05e-53) || ~((t <= 3.5e-33))) tmp = (y * (1.0 - z)) - t; else tmp = -log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.05e-53], N[Not[LessEqual[t, 3.5e-33]], $MachinePrecision]], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], (-N[Log[y], $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-53} \lor \neg \left(t \leq 3.5 \cdot 10^{-33}\right):\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\mathbf{else}:\\
\;\;\;\;-\log y\\
\end{array}
\end{array}
if t < -1.04999999999999989e-53 or 3.4999999999999999e-33 < t Initial program 93.3%
associate--l+93.3%
+-commutative93.3%
associate-+l-93.3%
*-commutative93.3%
*-commutative93.3%
sub-neg93.3%
metadata-eval93.3%
sub-neg93.3%
log1p-def99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 99.8%
associate-*r*99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
distribute-lft-in99.8%
metadata-eval99.8%
neg-mul-199.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t around inf 65.7%
if -1.04999999999999989e-53 < t < 3.4999999999999999e-33Initial program 89.0%
Taylor expanded in x around 0 43.6%
mul-1-neg43.6%
unsub-neg43.6%
*-commutative43.6%
sub-neg43.6%
metadata-eval43.6%
sub-neg43.6%
mul-1-neg43.6%
log1p-def54.3%
mul-1-neg54.3%
+-commutative54.3%
Simplified54.3%
Taylor expanded in y around 0 42.6%
neg-mul-142.6%
Simplified42.6%
Taylor expanded in t around 0 42.6%
mul-1-neg42.6%
Simplified42.6%
Final simplification55.4%
(FPCore (x y z t) :precision binary64 (if (<= t -9e-35) (- t) (if (<= t 320.0) (* y (- 1.0 z)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9e-35) {
tmp = -t;
} else if (t <= 320.0) {
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 <= (-9d-35)) then
tmp = -t
else if (t <= 320.0d0) 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 <= -9e-35) {
tmp = -t;
} else if (t <= 320.0) {
tmp = y * (1.0 - z);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -9e-35: tmp = -t elif t <= 320.0: tmp = y * (1.0 - z) else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -9e-35) tmp = Float64(-t); elseif (t <= 320.0) 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 <= -9e-35) tmp = -t; elseif (t <= 320.0) tmp = y * (1.0 - z); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -9e-35], (-t), If[LessEqual[t, 320.0], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{-35}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 320:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -9.0000000000000002e-35 or 320 < t Initial program 95.0%
Taylor expanded in y around 0 95.0%
Taylor expanded in t around inf 62.5%
neg-mul-162.5%
Simplified62.5%
if -9.0000000000000002e-35 < t < 320Initial program 87.3%
associate--l+87.3%
+-commutative87.3%
associate-+l-87.3%
*-commutative87.3%
*-commutative87.3%
sub-neg87.3%
metadata-eval87.3%
sub-neg87.3%
log1p-def99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 99.2%
associate-*r*99.2%
*-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
distribute-lft-in99.2%
metadata-eval99.2%
neg-mul-199.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in x around inf 62.0%
associate-*r*62.0%
mul-1-neg62.0%
Simplified62.0%
Taylor expanded in y around inf 16.2%
Final simplification40.4%
(FPCore (x y z t) :precision binary64 (if (<= t -1.42e-34) (- t) (if (<= t 320.0) (* z (- y)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.42e-34) {
tmp = -t;
} else if (t <= 320.0) {
tmp = z * -y;
} 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.42d-34)) then
tmp = -t
else if (t <= 320.0d0) then
tmp = z * -y
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.42e-34) {
tmp = -t;
} else if (t <= 320.0) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.42e-34: tmp = -t elif t <= 320.0: tmp = z * -y else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.42e-34) tmp = Float64(-t); elseif (t <= 320.0) tmp = Float64(z * Float64(-y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.42e-34) tmp = -t; elseif (t <= 320.0) tmp = z * -y; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.42e-34], (-t), If[LessEqual[t, 320.0], N[(z * (-y)), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.42 \cdot 10^{-34}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 320:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -1.42000000000000003e-34 or 320 < t Initial program 95.0%
Taylor expanded in y around 0 95.0%
Taylor expanded in t around inf 62.5%
neg-mul-162.5%
Simplified62.5%
if -1.42000000000000003e-34 < t < 320Initial program 87.3%
associate--l+87.3%
+-commutative87.3%
associate-+l-87.3%
*-commutative87.3%
*-commutative87.3%
sub-neg87.3%
metadata-eval87.3%
sub-neg87.3%
log1p-def99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 99.2%
associate-*r*99.2%
*-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
distribute-lft-in99.2%
metadata-eval99.2%
neg-mul-199.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in x around inf 62.0%
associate-*r*62.0%
mul-1-neg62.0%
Simplified62.0%
Taylor expanded in z around inf 15.6%
mul-1-neg15.6%
distribute-rgt-neg-in15.6%
Simplified15.6%
Final simplification40.1%
(FPCore (x y z t) :precision binary64 (- (* y (- 1.0 z)) t))
double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * (1.0d0 - z)) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) - t;
}
def code(x, y, z, t): return (y * (1.0 - z)) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(1.0 - z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * (1.0 - z)) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(1 - z\right) - t
\end{array}
Initial program 91.3%
associate--l+91.3%
+-commutative91.3%
associate-+l-91.3%
*-commutative91.3%
*-commutative91.3%
sub-neg91.3%
metadata-eval91.3%
sub-neg91.3%
log1p-def99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 99.5%
associate-*r*99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
neg-mul-199.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 42.9%
Final simplification42.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 91.3%
Taylor expanded in y around 0 90.9%
Taylor expanded in t around inf 34.1%
neg-mul-134.1%
Simplified34.1%
Final simplification34.1%
herbie shell --seed 2023192
(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))