
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (- (fma (+ z -1.0) (log1p (- y)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), (log(y) * (-1.0 + x))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 88.1%
+-commutative88.1%
fma-def88.1%
sub-neg88.1%
metadata-eval88.1%
sub-neg88.1%
log1p-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (+ (* (log1p (- y)) (+ z -1.0)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return ((log1p(-y) * (z + -1.0)) + (log(y) * (-1.0 + x))) - t;
}
public static double code(double x, double y, double z, double t) {
return ((Math.log1p(-y) * (z + -1.0)) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return ((math.log1p(-y) * (z + -1.0)) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log1p(Float64(-y)) * Float64(z + -1.0)) + Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 88.1%
Taylor expanded in z around 0 88.1%
distribute-rgt-out88.1%
sub-neg88.1%
mul-1-neg88.1%
log1p-def99.8%
mul-1-neg99.8%
Simplified99.8%
Final simplification99.8%
(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 88.1%
Taylor expanded in z around 0 88.1%
distribute-rgt-out88.1%
sub-neg88.1%
mul-1-neg88.1%
log1p-def99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
neg-mul-198.8%
distribute-rgt-neg-in98.8%
distribute-neg-in98.8%
metadata-eval98.8%
sub-neg98.8%
fma-def98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -4e+30)
(- (* x (log y)) t)
(if (<= (+ -1.0 x) -1.0)
(- (* y (- 1.0 z)) (+ (log y) t))
(- (* (log y) (+ -1.0 x)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -4e+30) {
tmp = (x * log(y)) - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = (y * (1.0 - z)) - (log(y) + t);
} else {
tmp = (log(y) * (-1.0 + 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) <= (-4d+30)) then
tmp = (x * log(y)) - t
else if (((-1.0d0) + x) <= (-1.0d0)) then
tmp = (y * (1.0d0 - z)) - (log(y) + t)
else
tmp = (log(y) * ((-1.0d0) + 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) <= -4e+30) {
tmp = (x * Math.log(y)) - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = (y * (1.0 - z)) - (Math.log(y) + t);
} else {
tmp = (Math.log(y) * (-1.0 + x)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -4e+30: tmp = (x * math.log(y)) - t elif (-1.0 + x) <= -1.0: tmp = (y * (1.0 - z)) - (math.log(y) + t) else: tmp = (math.log(y) * (-1.0 + x)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -4e+30) tmp = Float64(Float64(x * log(y)) - t); elseif (Float64(-1.0 + x) <= -1.0) tmp = Float64(Float64(y * Float64(1.0 - z)) - Float64(log(y) + t)); else tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -4e+30) tmp = (x * log(y)) - t; elseif ((-1.0 + x) <= -1.0) tmp = (y * (1.0 - z)) - (log(y) + t); else tmp = (log(y) * (-1.0 + x)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -4e+30], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -4 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{elif}\;-1 + x \leq -1:\\
\;\;\;\;y \cdot \left(1 - z\right) - \left(\log y + t\right)\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -4.0000000000000001e30Initial program 95.2%
Taylor expanded in z around 0 95.2%
distribute-rgt-out95.2%
sub-neg95.2%
mul-1-neg95.2%
log1p-def99.7%
mul-1-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 93.9%
*-commutative93.9%
Simplified93.9%
if -4.0000000000000001e30 < (-.f64 x 1) < -1Initial program 79.3%
Taylor expanded in y around 0 98.3%
+-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
*-commutative98.3%
mul-1-neg98.3%
unsub-neg98.3%
*-commutative98.3%
+-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 97.2%
mul-1-neg97.2%
Simplified97.2%
Taylor expanded in y around 0 97.2%
Taylor expanded in t around 0 97.2%
neg-mul-197.2%
neg-mul-197.2%
sub-neg97.2%
metadata-eval97.2%
distribute-neg-in97.2%
distribute-rgt-neg-in97.2%
sub-neg97.2%
associate-+r-97.2%
neg-mul-197.2%
remove-double-neg97.2%
mul-1-neg97.2%
log-rec97.2%
neg-mul-197.2%
distribute-lft-in97.2%
unsub-neg97.2%
distribute-rgt-neg-in97.2%
distribute-neg-in97.2%
metadata-eval97.2%
Simplified97.2%
if -1 < (-.f64 x 1) Initial program 97.8%
+-commutative97.8%
fma-def97.8%
sub-neg97.8%
metadata-eval97.8%
sub-neg97.8%
log1p-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.8%
Final simplification96.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t)))
(if (<= x -1.0)
t_1
(if (<= x 5.2e-70)
(- y (+ (log y) t))
(if (<= x 3.2e-15) (- (* y (- 1.0 z)) (log y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - t;
double tmp;
if (x <= -1.0) {
tmp = t_1;
} else if (x <= 5.2e-70) {
tmp = y - (log(y) + t);
} else if (x <= 3.2e-15) {
tmp = (y * (1.0 - z)) - log(y);
} 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) :: tmp
t_1 = (x * log(y)) - t
if (x <= (-1.0d0)) then
tmp = t_1
else if (x <= 5.2d-70) then
tmp = y - (log(y) + t)
else if (x <= 3.2d-15) then
tmp = (y * (1.0d0 - z)) - log(y)
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 = (x * Math.log(y)) - t;
double tmp;
if (x <= -1.0) {
tmp = t_1;
} else if (x <= 5.2e-70) {
tmp = y - (Math.log(y) + t);
} else if (x <= 3.2e-15) {
tmp = (y * (1.0 - z)) - Math.log(y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - t tmp = 0 if x <= -1.0: tmp = t_1 elif x <= 5.2e-70: tmp = y - (math.log(y) + t) elif x <= 3.2e-15: tmp = (y * (1.0 - z)) - math.log(y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -1.0) tmp = t_1; elseif (x <= 5.2e-70) tmp = Float64(y - Float64(log(y) + t)); elseif (x <= 3.2e-15) tmp = Float64(Float64(y * Float64(1.0 - z)) - log(y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - t; tmp = 0.0; if (x <= -1.0) tmp = t_1; elseif (x <= 5.2e-70) tmp = y - (log(y) + t); elseif (x <= 3.2e-15) tmp = (y * (1.0 - z)) - log(y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -1.0], t$95$1, If[LessEqual[x, 5.2e-70], N[(y - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.2e-15], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-70}:\\
\;\;\;\;y - \left(\log y + t\right)\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-15}:\\
\;\;\;\;y \cdot \left(1 - z\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1 or 3.1999999999999999e-15 < x Initial program 94.8%
Taylor expanded in z around 0 94.8%
distribute-rgt-out94.8%
sub-neg94.8%
mul-1-neg94.8%
log1p-def99.7%
mul-1-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 94.0%
*-commutative94.0%
Simplified94.0%
if -1 < x < 5.20000000000000004e-70Initial program 82.0%
Taylor expanded in y around 0 98.0%
+-commutative98.0%
sub-neg98.0%
metadata-eval98.0%
*-commutative98.0%
mul-1-neg98.0%
unsub-neg98.0%
*-commutative98.0%
+-commutative98.0%
sub-neg98.0%
metadata-eval98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 97.7%
mul-1-neg97.7%
Simplified97.7%
Taylor expanded in y around 0 97.7%
Taylor expanded in z around 0 79.2%
mul-1-neg79.2%
+-commutative79.2%
unsub-neg79.2%
Simplified79.2%
if 5.20000000000000004e-70 < x < 3.1999999999999999e-15Initial program 63.2%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in t around 0 99.9%
neg-mul-199.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
distribute-neg-in99.9%
distribute-rgt-neg-in99.9%
unsub-neg99.9%
distribute-rgt-neg-in99.9%
distribute-neg-in99.9%
metadata-eval99.9%
sub-neg99.9%
Simplified99.9%
Final simplification88.0%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -4e+30)
(- (* x (log y)) t)
(if (<= (+ -1.0 x) -1.0)
(- (- (* y (- z)) (log y)) t)
(- (* (log y) (+ -1.0 x)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -4e+30) {
tmp = (x * log(y)) - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = ((y * -z) - log(y)) - t;
} else {
tmp = (log(y) * (-1.0 + 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) <= (-4d+30)) then
tmp = (x * log(y)) - t
else if (((-1.0d0) + x) <= (-1.0d0)) then
tmp = ((y * -z) - log(y)) - t
else
tmp = (log(y) * ((-1.0d0) + 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) <= -4e+30) {
tmp = (x * Math.log(y)) - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = ((y * -z) - Math.log(y)) - t;
} else {
tmp = (Math.log(y) * (-1.0 + x)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -4e+30: tmp = (x * math.log(y)) - t elif (-1.0 + x) <= -1.0: tmp = ((y * -z) - math.log(y)) - t else: tmp = (math.log(y) * (-1.0 + x)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -4e+30) tmp = Float64(Float64(x * log(y)) - t); elseif (Float64(-1.0 + x) <= -1.0) tmp = Float64(Float64(Float64(y * Float64(-z)) - log(y)) - t); else tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -4e+30) tmp = (x * log(y)) - t; elseif ((-1.0 + x) <= -1.0) tmp = ((y * -z) - log(y)) - t; else tmp = (log(y) * (-1.0 + x)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -4e+30], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0], N[(N[(N[(y * (-z)), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -4 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{elif}\;-1 + x \leq -1:\\
\;\;\;\;\left(y \cdot \left(-z\right) - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -4.0000000000000001e30Initial program 95.2%
Taylor expanded in z around 0 95.2%
distribute-rgt-out95.2%
sub-neg95.2%
mul-1-neg95.2%
log1p-def99.7%
mul-1-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 93.9%
*-commutative93.9%
Simplified93.9%
if -4.0000000000000001e30 < (-.f64 x 1) < -1Initial program 79.3%
Taylor expanded in y around 0 98.3%
+-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
*-commutative98.3%
mul-1-neg98.3%
unsub-neg98.3%
*-commutative98.3%
+-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 97.2%
mul-1-neg97.2%
Simplified97.2%
Taylor expanded in z around inf 96.9%
if -1 < (-.f64 x 1) Initial program 97.8%
+-commutative97.8%
fma-def97.8%
sub-neg97.8%
metadata-eval97.8%
sub-neg97.8%
log1p-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.8%
Final simplification96.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -3e+49)
t_1
(if (<= x -1.3e-25)
(- (* y (- (- z) -1.0)) t)
(if (<= x 7.6e+25) (- y (+ (log y) t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -3e+49) {
tmp = t_1;
} else if (x <= -1.3e-25) {
tmp = (y * (-z - -1.0)) - t;
} else if (x <= 7.6e+25) {
tmp = y - (log(y) + t);
} 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) :: tmp
t_1 = x * log(y)
if (x <= (-3d+49)) then
tmp = t_1
else if (x <= (-1.3d-25)) then
tmp = (y * (-z - (-1.0d0))) - t
else if (x <= 7.6d+25) then
tmp = y - (log(y) + t)
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 = x * Math.log(y);
double tmp;
if (x <= -3e+49) {
tmp = t_1;
} else if (x <= -1.3e-25) {
tmp = (y * (-z - -1.0)) - t;
} else if (x <= 7.6e+25) {
tmp = y - (Math.log(y) + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -3e+49: tmp = t_1 elif x <= -1.3e-25: tmp = (y * (-z - -1.0)) - t elif x <= 7.6e+25: tmp = y - (math.log(y) + t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -3e+49) tmp = t_1; elseif (x <= -1.3e-25) tmp = Float64(Float64(y * Float64(Float64(-z) - -1.0)) - t); elseif (x <= 7.6e+25) tmp = Float64(y - Float64(log(y) + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -3e+49) tmp = t_1; elseif (x <= -1.3e-25) tmp = (y * (-z - -1.0)) - t; elseif (x <= 7.6e+25) tmp = y - (log(y) + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+49], t$95$1, If[LessEqual[x, -1.3e-25], N[(N[(y * N[((-z) - -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 7.6e+25], N[(y - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -3 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-25}:\\
\;\;\;\;y \cdot \left(\left(-z\right) - -1\right) - t\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{+25}:\\
\;\;\;\;y - \left(\log y + t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.0000000000000002e49 or 7.6000000000000001e25 < x Initial program 96.7%
Taylor expanded in z around 0 96.7%
distribute-rgt-out96.7%
sub-neg96.7%
mul-1-neg96.7%
log1p-def99.6%
mul-1-neg99.6%
Simplified99.6%
Taylor expanded in y around 0 99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
neg-mul-199.1%
distribute-rgt-neg-in99.1%
distribute-neg-in99.1%
metadata-eval99.1%
sub-neg99.1%
fma-def99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in x around inf 82.3%
*-commutative82.3%
Simplified82.3%
if -3.0000000000000002e49 < x < -1.3e-25Initial program 72.5%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 85.6%
mul-1-neg85.6%
Simplified85.6%
Taylor expanded in y around -inf 79.3%
if -1.3e-25 < x < 7.6000000000000001e25Initial program 82.6%
Taylor expanded in y around 0 98.2%
+-commutative98.2%
sub-neg98.2%
metadata-eval98.2%
*-commutative98.2%
mul-1-neg98.2%
unsub-neg98.2%
*-commutative98.2%
+-commutative98.2%
sub-neg98.2%
metadata-eval98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 97.4%
mul-1-neg97.4%
Simplified97.4%
Taylor expanded in y around 0 97.4%
Taylor expanded in z around 0 79.5%
mul-1-neg79.5%
+-commutative79.5%
unsub-neg79.5%
Simplified79.5%
Final simplification80.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -5.6e+47)
t_1
(if (<= x -1.3e-25)
(- (* y (- (- z) -1.0)) t)
(if (<= x 3.6e+25) (- (- t) (log y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -5.6e+47) {
tmp = t_1;
} else if (x <= -1.3e-25) {
tmp = (y * (-z - -1.0)) - t;
} else if (x <= 3.6e+25) {
tmp = -t - log(y);
} 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) :: tmp
t_1 = x * log(y)
if (x <= (-5.6d+47)) then
tmp = t_1
else if (x <= (-1.3d-25)) then
tmp = (y * (-z - (-1.0d0))) - t
else if (x <= 3.6d+25) then
tmp = -t - log(y)
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 = x * Math.log(y);
double tmp;
if (x <= -5.6e+47) {
tmp = t_1;
} else if (x <= -1.3e-25) {
tmp = (y * (-z - -1.0)) - t;
} else if (x <= 3.6e+25) {
tmp = -t - Math.log(y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -5.6e+47: tmp = t_1 elif x <= -1.3e-25: tmp = (y * (-z - -1.0)) - t elif x <= 3.6e+25: tmp = -t - math.log(y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -5.6e+47) tmp = t_1; elseif (x <= -1.3e-25) tmp = Float64(Float64(y * Float64(Float64(-z) - -1.0)) - t); elseif (x <= 3.6e+25) tmp = Float64(Float64(-t) - log(y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -5.6e+47) tmp = t_1; elseif (x <= -1.3e-25) tmp = (y * (-z - -1.0)) - t; elseif (x <= 3.6e+25) tmp = -t - log(y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.6e+47], t$95$1, If[LessEqual[x, -1.3e-25], N[(N[(y * N[((-z) - -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 3.6e+25], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -5.6 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-25}:\\
\;\;\;\;y \cdot \left(\left(-z\right) - -1\right) - t\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+25}:\\
\;\;\;\;\left(-t\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -5.59999999999999976e47 or 3.60000000000000015e25 < x Initial program 96.7%
Taylor expanded in z around 0 96.7%
distribute-rgt-out96.7%
sub-neg96.7%
mul-1-neg96.7%
log1p-def99.6%
mul-1-neg99.6%
Simplified99.6%
Taylor expanded in y around 0 99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
neg-mul-199.1%
distribute-rgt-neg-in99.1%
distribute-neg-in99.1%
metadata-eval99.1%
sub-neg99.1%
fma-def99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in x around inf 82.3%
*-commutative82.3%
Simplified82.3%
if -5.59999999999999976e47 < x < -1.3e-25Initial program 72.5%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 85.6%
mul-1-neg85.6%
Simplified85.6%
Taylor expanded in y around -inf 79.3%
if -1.3e-25 < x < 3.60000000000000015e25Initial program 82.6%
Taylor expanded in y around 0 98.2%
+-commutative98.2%
sub-neg98.2%
metadata-eval98.2%
*-commutative98.2%
mul-1-neg98.2%
unsub-neg98.2%
*-commutative98.2%
+-commutative98.2%
sub-neg98.2%
metadata-eval98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 97.4%
mul-1-neg97.4%
Simplified97.4%
Taylor expanded in y around 0 79.2%
mul-1-neg79.2%
Simplified79.2%
Final simplification80.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) (+ -1.0 x))))
(if (or (<= t -6600000.0) (not (<= t 1.05e-33)))
(- t_1 t)
(- t_1 (* z y)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * (-1.0 + x);
double tmp;
if ((t <= -6600000.0) || !(t <= 1.05e-33)) {
tmp = t_1 - t;
} else {
tmp = 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 = log(y) * ((-1.0d0) + x)
if ((t <= (-6600000.0d0)) .or. (.not. (t <= 1.05d-33))) then
tmp = t_1 - t
else
tmp = 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 = Math.log(y) * (-1.0 + x);
double tmp;
if ((t <= -6600000.0) || !(t <= 1.05e-33)) {
tmp = t_1 - t;
} else {
tmp = t_1 - (z * y);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * (-1.0 + x) tmp = 0 if (t <= -6600000.0) or not (t <= 1.05e-33): tmp = t_1 - t else: tmp = t_1 - (z * y) return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * Float64(-1.0 + x)) tmp = 0.0 if ((t <= -6600000.0) || !(t <= 1.05e-33)) tmp = Float64(t_1 - t); else tmp = Float64(t_1 - Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * (-1.0 + x); tmp = 0.0; if ((t <= -6600000.0) || ~((t <= 1.05e-33))) tmp = t_1 - t; else tmp = t_1 - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -6600000.0], N[Not[LessEqual[t, 1.05e-33]], $MachinePrecision]], N[(t$95$1 - t), $MachinePrecision], N[(t$95$1 - N[(z * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(-1 + x\right)\\
\mathbf{if}\;t \leq -6600000 \lor \neg \left(t \leq 1.05 \cdot 10^{-33}\right):\\
\;\;\;\;t_1 - t\\
\mathbf{else}:\\
\;\;\;\;t_1 - z \cdot y\\
\end{array}
\end{array}
if t < -6.6e6 or 1.05e-33 < t Initial program 96.4%
+-commutative96.4%
fma-def96.4%
sub-neg96.4%
metadata-eval96.4%
sub-neg96.4%
log1p-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 96.4%
if -6.6e6 < t < 1.05e-33Initial program 81.5%
Taylor expanded in y around 0 97.9%
+-commutative97.9%
sub-neg97.9%
metadata-eval97.9%
*-commutative97.9%
mul-1-neg97.9%
unsub-neg97.9%
*-commutative97.9%
+-commutative97.9%
sub-neg97.9%
metadata-eval97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in z around inf 97.7%
Taylor expanded in t around 0 97.1%
Final simplification96.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.0) (not (<= x 4.8e-14))) (- (* 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.8e-14)) {
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.8d-14))) 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.8e-14)) {
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.8e-14): 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.8e-14)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(y - 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.8e-14))) 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.8e-14]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(y - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 4.8 \cdot 10^{-14}\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;y - \left(\log y + t\right)\\
\end{array}
\end{array}
if x < -1 or 4.8e-14 < x Initial program 94.8%
Taylor expanded in z around 0 94.8%
distribute-rgt-out94.8%
sub-neg94.8%
mul-1-neg94.8%
log1p-def99.7%
mul-1-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 94.0%
*-commutative94.0%
Simplified94.0%
if -1 < x < 4.8e-14Initial program 80.3%
Taylor expanded in y around 0 98.2%
+-commutative98.2%
sub-neg98.2%
metadata-eval98.2%
*-commutative98.2%
mul-1-neg98.2%
unsub-neg98.2%
*-commutative98.2%
+-commutative98.2%
sub-neg98.2%
metadata-eval98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 97.9%
mul-1-neg97.9%
Simplified97.9%
Taylor expanded in y around 0 97.9%
Taylor expanded in z around 0 77.7%
mul-1-neg77.7%
+-commutative77.7%
unsub-neg77.7%
Simplified77.7%
Final simplification86.4%
(FPCore (x y z t) :precision binary64 (if (<= (+ z -1.0) -2e+300) (* y (- z)) (- (* (log y) (+ -1.0 x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z + -1.0) <= -2e+300) {
tmp = y * -z;
} else {
tmp = (log(y) * (-1.0 + 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 ((z + (-1.0d0)) <= (-2d+300)) then
tmp = y * -z
else
tmp = (log(y) * ((-1.0d0) + x)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z + -1.0) <= -2e+300) {
tmp = y * -z;
} else {
tmp = (Math.log(y) * (-1.0 + x)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z + -1.0) <= -2e+300: tmp = y * -z else: tmp = (math.log(y) * (-1.0 + x)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z + -1.0) <= -2e+300) tmp = Float64(y * Float64(-z)); else tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z + -1.0) <= -2e+300) tmp = y * -z; else tmp = (log(y) * (-1.0 + x)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z + -1.0), $MachinePrecision], -2e+300], N[(y * (-z)), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z + -1 \leq -2 \cdot 10^{+300}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\end{array}
\end{array}
if (-.f64 z 1) < -2.0000000000000001e300Initial program 4.5%
Taylor expanded in z around 0 4.5%
distribute-rgt-out4.5%
sub-neg4.5%
mul-1-neg4.5%
log1p-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
neg-mul-1100.0%
distribute-rgt-neg-in100.0%
distribute-neg-in100.0%
metadata-eval100.0%
sub-neg100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
associate-*r*100.0%
mul-1-neg100.0%
Simplified100.0%
if -2.0000000000000001e300 < (-.f64 z 1) Initial program 89.7%
+-commutative89.7%
fma-def89.7%
sub-neg89.7%
metadata-eval89.7%
sub-neg89.7%
log1p-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 88.2%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.32e+47) (not (<= x 1.25e+23))) (* x (log y)) (- (* y (- (- z) -1.0)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.32e+47) || !(x <= 1.25e+23)) {
tmp = x * log(y);
} else {
tmp = (y * (-z - -1.0)) - 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.32d+47)) .or. (.not. (x <= 1.25d+23))) then
tmp = x * log(y)
else
tmp = (y * (-z - (-1.0d0))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.32e+47) || !(x <= 1.25e+23)) {
tmp = x * Math.log(y);
} else {
tmp = (y * (-z - -1.0)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.32e+47) or not (x <= 1.25e+23): tmp = x * math.log(y) else: tmp = (y * (-z - -1.0)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.32e+47) || !(x <= 1.25e+23)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(y * Float64(Float64(-z) - -1.0)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.32e+47) || ~((x <= 1.25e+23))) tmp = x * log(y); else tmp = (y * (-z - -1.0)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.32e+47], N[Not[LessEqual[x, 1.25e+23]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * N[((-z) - -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{+47} \lor \neg \left(x \leq 1.25 \cdot 10^{+23}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\left(-z\right) - -1\right) - t\\
\end{array}
\end{array}
if x < -1.31999999999999992e47 or 1.25e23 < x Initial program 96.7%
Taylor expanded in z around 0 96.7%
distribute-rgt-out96.7%
sub-neg96.7%
mul-1-neg96.7%
log1p-def99.6%
mul-1-neg99.6%
Simplified99.6%
Taylor expanded in y around 0 99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
neg-mul-199.1%
distribute-rgt-neg-in99.1%
distribute-neg-in99.1%
metadata-eval99.1%
sub-neg99.1%
fma-def99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in x around inf 82.3%
*-commutative82.3%
Simplified82.3%
if -1.31999999999999992e47 < x < 1.25e23Initial program 81.0%
Taylor expanded in y around 0 98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
*-commutative98.5%
mul-1-neg98.5%
unsub-neg98.5%
*-commutative98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in x around 0 95.4%
mul-1-neg95.4%
Simplified95.4%
Taylor expanded in y around -inf 62.5%
Final simplification71.4%
(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 88.1%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (- (- (* (log y) (+ -1.0 x)) t) (* y (+ z -1.0))))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) - t) - (y * (z + -1.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) - t) - (y * (z + (-1.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) - t) - (y * (z + -1.0));
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) - t) - (y * (z + -1.0))
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) - t) - Float64(y * Float64(z + -1.0))) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) - t) - (y * (z + -1.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) - t\right) - y \cdot \left(z + -1\right)
\end{array}
Initial program 88.1%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in t around 0 98.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (- (- (* (log y) (+ -1.0 x)) (* z y)) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) - (z * y)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) - (z * y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) - (z * y)) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) - (z * y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) - Float64(z * y)) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) - (z * y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) - z \cdot y\right) - t
\end{array}
Initial program 88.1%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in z around inf 98.6%
Final simplification98.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2900000.0) (not (<= t 145000.0))) (- t) (* y (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2900000.0) || !(t <= 145000.0)) {
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 <= (-2900000.0d0)) .or. (.not. (t <= 145000.0d0))) 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 <= -2900000.0) || !(t <= 145000.0)) {
tmp = -t;
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2900000.0) or not (t <= 145000.0): tmp = -t else: tmp = y * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2900000.0) || !(t <= 145000.0)) 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 <= -2900000.0) || ~((t <= 145000.0))) tmp = -t; else tmp = y * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2900000.0], N[Not[LessEqual[t, 145000.0]], $MachinePrecision]], (-t), N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2900000 \lor \neg \left(t \leq 145000\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if t < -2.9e6 or 145000 < t Initial program 96.0%
+-commutative96.0%
fma-def96.0%
sub-neg96.0%
metadata-eval96.0%
sub-neg96.0%
log1p-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 75.1%
neg-mul-175.1%
Simplified75.1%
if -2.9e6 < t < 145000Initial program 82.9%
Taylor expanded in z around 0 82.9%
distribute-rgt-out82.9%
sub-neg82.9%
mul-1-neg82.9%
log1p-def99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 98.1%
sub-neg98.1%
metadata-eval98.1%
+-commutative98.1%
neg-mul-198.1%
distribute-rgt-neg-in98.1%
distribute-neg-in98.1%
metadata-eval98.1%
sub-neg98.1%
fma-def98.1%
sub-neg98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in y around inf 19.3%
Final simplification41.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9200000.0) (not (<= t 3350000.0))) (- t) (* y (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9200000.0) || !(t <= 3350000.0)) {
tmp = -t;
} else {
tmp = y * -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 <= (-9200000.0d0)) .or. (.not. (t <= 3350000.0d0))) then
tmp = -t
else
tmp = y * -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9200000.0) || !(t <= 3350000.0)) {
tmp = -t;
} else {
tmp = y * -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9200000.0) or not (t <= 3350000.0): tmp = -t else: tmp = y * -z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9200000.0) || !(t <= 3350000.0)) tmp = Float64(-t); else tmp = Float64(y * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -9200000.0) || ~((t <= 3350000.0))) tmp = -t; else tmp = y * -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9200000.0], N[Not[LessEqual[t, 3350000.0]], $MachinePrecision]], (-t), N[(y * (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9200000 \lor \neg \left(t \leq 3350000\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\end{array}
\end{array}
if t < -9.2e6 or 3.35e6 < t Initial program 96.0%
+-commutative96.0%
fma-def96.0%
sub-neg96.0%
metadata-eval96.0%
sub-neg96.0%
log1p-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 75.1%
neg-mul-175.1%
Simplified75.1%
if -9.2e6 < t < 3.35e6Initial program 82.9%
Taylor expanded in z around 0 82.9%
distribute-rgt-out82.9%
sub-neg82.9%
mul-1-neg82.9%
log1p-def99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 98.1%
sub-neg98.1%
metadata-eval98.1%
+-commutative98.1%
neg-mul-198.1%
distribute-rgt-neg-in98.1%
distribute-neg-in98.1%
metadata-eval98.1%
sub-neg98.1%
fma-def98.1%
sub-neg98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in z around inf 18.8%
associate-*r*18.8%
mul-1-neg18.8%
Simplified18.8%
Final simplification41.0%
(FPCore (x y z t) :precision binary64 (- (* y (- (- z) -1.0)) t))
double code(double x, double y, double z, double t) {
return (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 = (y * (-z - (-1.0d0))) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * (-z - -1.0)) - t;
}
def code(x, y, z, t): return (y * (-z - -1.0)) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(Float64(-z) - -1.0)) - t) end
function tmp = code(x, y, z, t) tmp = (y * (-z - -1.0)) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[((-z) - -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(\left(-z\right) - -1\right) - t
\end{array}
Initial program 88.1%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in x around 0 60.9%
mul-1-neg60.9%
Simplified60.9%
Taylor expanded in y around -inf 42.8%
Final simplification42.8%
(FPCore (x y z t) :precision binary64 (- (* y (- z)) t))
double code(double x, double y, double z, double t) {
return (y * -z) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * -z) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * -z) - t;
}
def code(x, y, z, t): return (y * -z) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(-z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * -z) - t; end
code[x_, y_, z_, t_] := N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-z\right) - t
\end{array}
Initial program 88.1%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in z around inf 42.6%
associate-*r*42.6%
mul-1-neg42.6%
Simplified42.6%
Final simplification42.6%
(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 88.1%
+-commutative88.1%
fma-def88.1%
sub-neg88.1%
metadata-eval88.1%
sub-neg88.1%
log1p-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 31.3%
neg-mul-131.3%
Simplified31.3%
Final simplification31.3%
herbie shell --seed 2024018
(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))