
(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 (- (* (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 90.6%
associate--l+90.6%
+-commutative90.6%
associate-+l-90.6%
*-commutative90.6%
*-commutative90.6%
sub-neg90.6%
metadata-eval90.6%
sub-neg90.6%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (- (+ (* (- (* y (* y -0.5)) y) (+ z -1.0)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return ((((y * (y * -0.5)) - y) * (z + -1.0)) + (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 = ((((y * (y * (-0.5d0))) - y) * (z + (-1.0d0))) + (log(y) * ((-1.0d0) + x))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((((y * (y * -0.5)) - y) * (z + -1.0)) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return ((((y * (y * -0.5)) - y) * (z + -1.0)) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(Float64(y * Float64(y * -0.5)) - y) * Float64(z + -1.0)) + Float64(log(y) * Float64(-1.0 + x))) - t) end
function tmp = code(x, y, z, t) tmp = ((((y * (y * -0.5)) - y) * (z + -1.0)) + (log(y) * (-1.0 + x))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[(y * N[(y * -0.5), $MachinePrecision]), $MachinePrecision] - 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(\left(y \cdot \left(y \cdot -0.5\right) - y\right) \cdot \left(z + -1\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 90.6%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
unpow299.8%
associate-*l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -2e+63) (not (<= (+ -1.0 x) -0.5))) (- (* (log y) (+ -1.0 x)) t) (- (- (* y (- 1.0 z)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -2e+63) || !((-1.0 + x) <= -0.5)) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = ((y * (1.0 - z)) - log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((((-1.0d0) + x) <= (-2d+63)) .or. (.not. (((-1.0d0) + x) <= (-0.5d0)))) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = ((y * (1.0d0 - z)) - log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -2e+63) || !((-1.0 + x) <= -0.5)) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -2e+63) or not ((-1.0 + x) <= -0.5): tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = ((y * (1.0 - z)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -2e+63) || !(Float64(-1.0 + x) <= -0.5)) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -2e+63) || ~(((-1.0 + x) <= -0.5))) tmp = (log(y) * (-1.0 + x)) - t; else tmp = ((y * (1.0 - z)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -2e+63], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.5]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -2 \cdot 10^{+63} \lor \neg \left(-1 + x \leq -0.5\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -2.00000000000000012e63 or -0.5 < (-.f64 x 1) Initial program 95.0%
Taylor expanded in y around 0 94.1%
if -2.00000000000000012e63 < (-.f64 x 1) < -0.5Initial program 86.7%
Taylor expanded in y around 0 100.0%
Taylor expanded in y around 0 99.5%
mul-1-neg99.5%
sub-neg99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in x around 0 96.5%
mul-1-neg96.5%
unsub-neg96.5%
Simplified96.5%
Final simplification95.4%
(FPCore (x y z t) :precision binary64 (- (+ (* z (- (* -0.5 (* y y)) y)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return ((z * ((-0.5 * (y * y)) - y)) + (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 = ((z * (((-0.5d0) * (y * y)) - y)) + (log(y) * ((-1.0d0) + x))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((z * ((-0.5 * (y * y)) - y)) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return ((z * ((-0.5 * (y * y)) - y)) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(z * Float64(Float64(-0.5 * Float64(y * y)) - y)) + Float64(log(y) * Float64(-1.0 + x))) - t) end
function tmp = code(x, y, z, t) tmp = ((z * ((-0.5 * (y * y)) - y)) + (log(y) * (-1.0 + x))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(z * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 90.6%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
unpow299.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
unpow299.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (- (- (* (* y y) (+ 0.5 (* z -0.5))) (* y (+ z -1.0))) t))
(t_3 (- (log y))))
(if (<= x -2.95e+63)
t_1
(if (<= x 2e-246)
t_2
(if (<= x 2.1e-228)
t_3
(if (<= x 2.15e-99)
(- (- y (* z y)) t)
(if (<= x 4.5e-81) t_3 (if (<= x 7.2e+119) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double t_2 = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
double t_3 = -log(y);
double tmp;
if (x <= -2.95e+63) {
tmp = t_1;
} else if (x <= 2e-246) {
tmp = t_2;
} else if (x <= 2.1e-228) {
tmp = t_3;
} else if (x <= 2.15e-99) {
tmp = (y - (z * y)) - t;
} else if (x <= 4.5e-81) {
tmp = t_3;
} else if (x <= 7.2e+119) {
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) :: t_3
real(8) :: tmp
t_1 = log(y) * x
t_2 = (((y * y) * (0.5d0 + (z * (-0.5d0)))) - (y * (z + (-1.0d0)))) - t
t_3 = -log(y)
if (x <= (-2.95d+63)) then
tmp = t_1
else if (x <= 2d-246) then
tmp = t_2
else if (x <= 2.1d-228) then
tmp = t_3
else if (x <= 2.15d-99) then
tmp = (y - (z * y)) - t
else if (x <= 4.5d-81) then
tmp = t_3
else if (x <= 7.2d+119) 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 = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
double t_3 = -Math.log(y);
double tmp;
if (x <= -2.95e+63) {
tmp = t_1;
} else if (x <= 2e-246) {
tmp = t_2;
} else if (x <= 2.1e-228) {
tmp = t_3;
} else if (x <= 2.15e-99) {
tmp = (y - (z * y)) - t;
} else if (x <= 4.5e-81) {
tmp = t_3;
} else if (x <= 7.2e+119) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x t_2 = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t t_3 = -math.log(y) tmp = 0 if x <= -2.95e+63: tmp = t_1 elif x <= 2e-246: tmp = t_2 elif x <= 2.1e-228: tmp = t_3 elif x <= 2.15e-99: tmp = (y - (z * y)) - t elif x <= 4.5e-81: tmp = t_3 elif x <= 7.2e+119: 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(Float64(Float64(y * y) * Float64(0.5 + Float64(z * -0.5))) - Float64(y * Float64(z + -1.0))) - t) t_3 = Float64(-log(y)) tmp = 0.0 if (x <= -2.95e+63) tmp = t_1; elseif (x <= 2e-246) tmp = t_2; elseif (x <= 2.1e-228) tmp = t_3; elseif (x <= 2.15e-99) tmp = Float64(Float64(y - Float64(z * y)) - t); elseif (x <= 4.5e-81) tmp = t_3; elseif (x <= 7.2e+119) 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 = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t; t_3 = -log(y); tmp = 0.0; if (x <= -2.95e+63) tmp = t_1; elseif (x <= 2e-246) tmp = t_2; elseif (x <= 2.1e-228) tmp = t_3; elseif (x <= 2.15e-99) tmp = (y - (z * y)) - t; elseif (x <= 4.5e-81) tmp = t_3; elseif (x <= 7.2e+119) 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[(N[(N[(N[(y * y), $MachinePrecision] * N[(0.5 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$3 = (-N[Log[y], $MachinePrecision])}, If[LessEqual[x, -2.95e+63], t$95$1, If[LessEqual[x, 2e-246], t$95$2, If[LessEqual[x, 2.1e-228], t$95$3, If[LessEqual[x, 2.15e-99], N[(N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 4.5e-81], t$95$3, If[LessEqual[x, 7.2e+119], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := \left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\
t_3 := -\log y\\
\mathbf{if}\;x \leq -2.95 \cdot 10^{+63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-246}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-228}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-99}:\\
\;\;\;\;\left(y - z \cdot y\right) - t\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-81}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+119}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.95000000000000014e63 or 7.20000000000000003e119 < x Initial program 95.7%
associate--l+95.7%
+-commutative95.7%
associate-+l-95.7%
*-commutative95.7%
*-commutative95.7%
sub-neg95.7%
metadata-eval95.7%
sub-neg95.7%
log1p-def99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-def99.7%
neg-sub099.7%
associate--r-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 76.1%
if -2.95000000000000014e63 < x < 1.99999999999999991e-246 or 4.5e-81 < x < 7.20000000000000003e119Initial program 87.8%
associate--l+87.8%
+-commutative87.8%
associate-+l-87.8%
*-commutative87.8%
*-commutative87.8%
sub-neg87.8%
metadata-eval87.8%
sub-neg87.8%
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 t around inf 67.1%
Taylor expanded in y around 0 67.1%
mul-1-neg67.1%
unsub-neg67.1%
associate-*r*67.1%
sub-neg67.1%
metadata-eval67.1%
+-commutative67.1%
distribute-lft-in67.1%
metadata-eval67.1%
unpow267.1%
*-commutative67.1%
sub-neg67.1%
metadata-eval67.1%
+-commutative67.1%
Simplified67.1%
if 1.99999999999999991e-246 < x < 2.09999999999999991e-228 or 2.1499999999999999e-99 < x < 4.5e-81Initial program 97.3%
associate--l+97.3%
+-commutative97.3%
associate-+l-97.3%
*-commutative97.3%
*-commutative97.3%
sub-neg97.3%
metadata-eval97.3%
sub-neg97.3%
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 97.3%
mul-1-neg97.3%
+-commutative97.3%
fma-def97.3%
Simplified97.3%
Taylor expanded in t around 0 90.7%
Taylor expanded in x around 0 90.7%
if 2.09999999999999991e-228 < x < 2.1499999999999999e-99Initial program 81.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in y around 0 100.0%
mul-1-neg100.0%
sub-neg100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 73.8%
sub-neg73.8%
distribute-lft-in73.8%
*-rgt-identity73.8%
distribute-rgt-neg-in73.8%
unsub-neg73.8%
Simplified73.8%
Final simplification72.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) (+ -1.0 x))))
(if (or (<= t -8.5e-12) (not (<= t 7.2e+16)))
(- t_1 t)
(+ (* y (- 1.0 z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * (-1.0 + x);
double tmp;
if ((t <= -8.5e-12) || !(t <= 7.2e+16)) {
tmp = t_1 - t;
} else {
tmp = (y * (1.0 - z)) + 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 = log(y) * ((-1.0d0) + x)
if ((t <= (-8.5d-12)) .or. (.not. (t <= 7.2d+16))) then
tmp = t_1 - t
else
tmp = (y * (1.0d0 - z)) + 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) * (-1.0 + x);
double tmp;
if ((t <= -8.5e-12) || !(t <= 7.2e+16)) {
tmp = t_1 - t;
} else {
tmp = (y * (1.0 - z)) + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * (-1.0 + x) tmp = 0 if (t <= -8.5e-12) or not (t <= 7.2e+16): tmp = t_1 - t else: tmp = (y * (1.0 - z)) + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * Float64(-1.0 + x)) tmp = 0.0 if ((t <= -8.5e-12) || !(t <= 7.2e+16)) tmp = Float64(t_1 - t); else tmp = Float64(Float64(y * Float64(1.0 - z)) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * (-1.0 + x); tmp = 0.0; if ((t <= -8.5e-12) || ~((t <= 7.2e+16))) tmp = t_1 - t; else tmp = (y * (1.0 - z)) + t_1; 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, -8.5e-12], N[Not[LessEqual[t, 7.2e+16]], $MachinePrecision]], N[(t$95$1 - t), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(-1 + x\right)\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{-12} \lor \neg \left(t \leq 7.2 \cdot 10^{+16}\right):\\
\;\;\;\;t_1 - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) + t_1\\
\end{array}
\end{array}
if t < -8.4999999999999997e-12 or 7.2e16 < t Initial program 93.6%
Taylor expanded in y around 0 93.3%
if -8.4999999999999997e-12 < t < 7.2e16Initial program 87.0%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 98.9%
mul-1-neg98.9%
sub-neg98.9%
metadata-eval98.9%
*-commutative98.9%
distribute-rgt-neg-in98.9%
+-commutative98.9%
distribute-neg-in98.9%
metadata-eval98.9%
unsub-neg98.9%
Simplified98.9%
Taylor expanded in t around 0 98.9%
Final simplification95.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= x -2.75e+63)
t_1
(if (<= x -4.5e-58)
(- (- y (* z y)) t)
(if (<= x 3.2e+32)
(- (- (log y)) t)
(if (or (<= x 1.95e+63) (not (<= x 3.1e+115)))
t_1
(- (* y (- z)) t)))))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -2.75e+63) {
tmp = t_1;
} else if (x <= -4.5e-58) {
tmp = (y - (z * y)) - t;
} else if (x <= 3.2e+32) {
tmp = -log(y) - t;
} else if ((x <= 1.95e+63) || !(x <= 3.1e+115)) {
tmp = t_1;
} else {
tmp = (y * -z) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = log(y) * x
if (x <= (-2.75d+63)) then
tmp = t_1
else if (x <= (-4.5d-58)) then
tmp = (y - (z * y)) - t
else if (x <= 3.2d+32) then
tmp = -log(y) - t
else if ((x <= 1.95d+63) .or. (.not. (x <= 3.1d+115))) then
tmp = t_1
else
tmp = (y * -z) - t
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 tmp;
if (x <= -2.75e+63) {
tmp = t_1;
} else if (x <= -4.5e-58) {
tmp = (y - (z * y)) - t;
} else if (x <= 3.2e+32) {
tmp = -Math.log(y) - t;
} else if ((x <= 1.95e+63) || !(x <= 3.1e+115)) {
tmp = t_1;
} else {
tmp = (y * -z) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -2.75e+63: tmp = t_1 elif x <= -4.5e-58: tmp = (y - (z * y)) - t elif x <= 3.2e+32: tmp = -math.log(y) - t elif (x <= 1.95e+63) or not (x <= 3.1e+115): tmp = t_1 else: tmp = (y * -z) - t return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -2.75e+63) tmp = t_1; elseif (x <= -4.5e-58) tmp = Float64(Float64(y - Float64(z * y)) - t); elseif (x <= 3.2e+32) tmp = Float64(Float64(-log(y)) - t); elseif ((x <= 1.95e+63) || !(x <= 3.1e+115)) tmp = t_1; else tmp = Float64(Float64(y * Float64(-z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; tmp = 0.0; if (x <= -2.75e+63) tmp = t_1; elseif (x <= -4.5e-58) tmp = (y - (z * y)) - t; elseif (x <= 3.2e+32) tmp = -log(y) - t; elseif ((x <= 1.95e+63) || ~((x <= 3.1e+115))) tmp = t_1; else tmp = (y * -z) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -2.75e+63], t$95$1, If[LessEqual[x, -4.5e-58], N[(N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 3.2e+32], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], If[Or[LessEqual[x, 1.95e+63], N[Not[LessEqual[x, 3.1e+115]], $MachinePrecision]], t$95$1, N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -2.75 \cdot 10^{+63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-58}:\\
\;\;\;\;\left(y - z \cdot y\right) - t\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+32}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+63} \lor \neg \left(x \leq 3.1 \cdot 10^{+115}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\end{array}
\end{array}
if x < -2.75000000000000002e63 or 3.1999999999999999e32 < x < 1.95e63 or 3.10000000000000005e115 < x Initial program 95.0%
associate--l+95.0%
+-commutative95.0%
associate-+l-95.0%
*-commutative95.0%
*-commutative95.0%
sub-neg95.0%
metadata-eval95.0%
sub-neg95.0%
log1p-def99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-def99.7%
neg-sub099.7%
associate--r-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 75.8%
if -2.75000000000000002e63 < x < -4.5000000000000003e-58Initial program 77.0%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 88.8%
mul-1-neg88.8%
unsub-neg88.8%
Simplified88.8%
Taylor expanded in y around inf 84.1%
sub-neg84.1%
distribute-lft-in84.1%
*-rgt-identity84.1%
distribute-rgt-neg-in84.1%
unsub-neg84.1%
Simplified84.1%
if -4.5000000000000003e-58 < x < 3.1999999999999999e32Initial program 90.1%
associate--l+90.1%
+-commutative90.1%
associate-+l-90.1%
*-commutative90.1%
*-commutative90.1%
sub-neg90.1%
metadata-eval90.1%
sub-neg90.1%
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 89.2%
mul-1-neg89.2%
+-commutative89.2%
fma-def89.2%
Simplified89.2%
Taylor expanded in x around 0 86.0%
+-commutative86.0%
Simplified86.0%
if 1.95e63 < x < 3.10000000000000005e115Initial program 91.7%
associate--l+91.7%
+-commutative91.7%
associate-+l-91.7%
*-commutative91.7%
*-commutative91.7%
sub-neg91.7%
metadata-eval91.7%
sub-neg91.7%
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 t around inf 76.2%
Taylor expanded in y around 0 76.2%
mul-1-neg76.2%
distribute-rgt-neg-in76.2%
sub-neg76.2%
metadata-eval76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in z around inf 76.2%
associate-*r*76.2%
mul-1-neg76.2%
Simplified76.2%
Final simplification81.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= x -1.9e+63)
t_1
(if (<= x -3.1e-58)
(- (- y (* z y)) t)
(if (<= x 3.1e+32)
(- (- y (log y)) t)
(if (or (<= x 6.2e+61) (not (<= x 7.2e+119)))
t_1
(- (* y (- z)) t)))))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -1.9e+63) {
tmp = t_1;
} else if (x <= -3.1e-58) {
tmp = (y - (z * y)) - t;
} else if (x <= 3.1e+32) {
tmp = (y - log(y)) - t;
} else if ((x <= 6.2e+61) || !(x <= 7.2e+119)) {
tmp = t_1;
} else {
tmp = (y * -z) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = log(y) * x
if (x <= (-1.9d+63)) then
tmp = t_1
else if (x <= (-3.1d-58)) then
tmp = (y - (z * y)) - t
else if (x <= 3.1d+32) then
tmp = (y - log(y)) - t
else if ((x <= 6.2d+61) .or. (.not. (x <= 7.2d+119))) then
tmp = t_1
else
tmp = (y * -z) - t
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 tmp;
if (x <= -1.9e+63) {
tmp = t_1;
} else if (x <= -3.1e-58) {
tmp = (y - (z * y)) - t;
} else if (x <= 3.1e+32) {
tmp = (y - Math.log(y)) - t;
} else if ((x <= 6.2e+61) || !(x <= 7.2e+119)) {
tmp = t_1;
} else {
tmp = (y * -z) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -1.9e+63: tmp = t_1 elif x <= -3.1e-58: tmp = (y - (z * y)) - t elif x <= 3.1e+32: tmp = (y - math.log(y)) - t elif (x <= 6.2e+61) or not (x <= 7.2e+119): tmp = t_1 else: tmp = (y * -z) - t return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -1.9e+63) tmp = t_1; elseif (x <= -3.1e-58) tmp = Float64(Float64(y - Float64(z * y)) - t); elseif (x <= 3.1e+32) tmp = Float64(Float64(y - log(y)) - t); elseif ((x <= 6.2e+61) || !(x <= 7.2e+119)) tmp = t_1; else tmp = Float64(Float64(y * Float64(-z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; tmp = 0.0; if (x <= -1.9e+63) tmp = t_1; elseif (x <= -3.1e-58) tmp = (y - (z * y)) - t; elseif (x <= 3.1e+32) tmp = (y - log(y)) - t; elseif ((x <= 6.2e+61) || ~((x <= 7.2e+119))) tmp = t_1; else tmp = (y * -z) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.9e+63], t$95$1, If[LessEqual[x, -3.1e-58], N[(N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 3.1e+32], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[x, 6.2e+61], N[Not[LessEqual[x, 7.2e+119]], $MachinePrecision]], t$95$1, N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{+63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{-58}:\\
\;\;\;\;\left(y - z \cdot y\right) - t\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+32}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+61} \lor \neg \left(x \leq 7.2 \cdot 10^{+119}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\end{array}
\end{array}
if x < -1.9000000000000001e63 or 3.09999999999999993e32 < x < 6.1999999999999998e61 or 7.20000000000000003e119 < x Initial program 95.0%
associate--l+95.0%
+-commutative95.0%
associate-+l-95.0%
*-commutative95.0%
*-commutative95.0%
sub-neg95.0%
metadata-eval95.0%
sub-neg95.0%
log1p-def99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-def99.7%
neg-sub099.7%
associate--r-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 75.8%
if -1.9000000000000001e63 < x < -3.0999999999999999e-58Initial program 77.0%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 88.8%
mul-1-neg88.8%
unsub-neg88.8%
Simplified88.8%
Taylor expanded in y around inf 84.1%
sub-neg84.1%
distribute-lft-in84.1%
*-rgt-identity84.1%
distribute-rgt-neg-in84.1%
unsub-neg84.1%
Simplified84.1%
if -3.0999999999999999e-58 < x < 3.09999999999999993e32Initial program 90.1%
Taylor expanded in y around 0 100.0%
Taylor expanded in y around 0 99.5%
mul-1-neg99.5%
sub-neg99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in x around 0 96.2%
mul-1-neg96.2%
unsub-neg96.2%
Simplified96.2%
Taylor expanded in z around 0 86.1%
if 6.1999999999999998e61 < x < 7.20000000000000003e119Initial program 91.7%
associate--l+91.7%
+-commutative91.7%
associate-+l-91.7%
*-commutative91.7%
*-commutative91.7%
sub-neg91.7%
metadata-eval91.7%
sub-neg91.7%
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 t around inf 76.2%
Taylor expanded in y around 0 76.2%
mul-1-neg76.2%
distribute-rgt-neg-in76.2%
sub-neg76.2%
metadata-eval76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in z around inf 76.2%
associate-*r*76.2%
mul-1-neg76.2%
Simplified76.2%
Final simplification81.3%
(FPCore (x y z t) :precision binary64 (- (+ (* y (- 1.0 z)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return ((y * (1.0 - z)) + (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 = ((y * (1.0d0 - z)) + (log(y) * ((-1.0d0) + x))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((y * (1.0 - z)) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return ((y * (1.0 - z)) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(y * Float64(1.0 - z)) + Float64(log(y) * Float64(-1.0 + x))) - t) end
function tmp = code(x, y, z, t) tmp = ((y * (1.0 - z)) + (log(y) * (-1.0 + x))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot \left(1 - z\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 90.6%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
sub-neg99.4%
metadata-eval99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (- (- (* (log y) (+ -1.0 x)) (* z y)) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) - (z * y)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) - (z * y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) - (z * y)) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) - (z * y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) - Float64(z * y)) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) - (z * y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) - z \cdot y\right) - t
\end{array}
Initial program 90.6%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
unpow299.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
unpow299.8%
Simplified99.8%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
*-commutative99.4%
/-rgt-identity99.4%
associate-/r/99.3%
mul-1-neg99.3%
unsub-neg99.3%
associate-/r/99.4%
/-rgt-identity99.4%
+-commutative99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= t -13200000000.0) (- (- (* (* y y) (+ 0.5 (* z -0.5))) (* y (+ z -1.0))) t) (if (<= t 9.5e+62) (* (log y) (+ -1.0 x)) (- (* y (- z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -13200000000.0) {
tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
} else if (t <= 9.5e+62) {
tmp = log(y) * (-1.0 + x);
} else {
tmp = (y * -z) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-13200000000.0d0)) then
tmp = (((y * y) * (0.5d0 + (z * (-0.5d0)))) - (y * (z + (-1.0d0)))) - t
else if (t <= 9.5d+62) then
tmp = log(y) * ((-1.0d0) + x)
else
tmp = (y * -z) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -13200000000.0) {
tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
} else if (t <= 9.5e+62) {
tmp = Math.log(y) * (-1.0 + x);
} else {
tmp = (y * -z) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -13200000000.0: tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t elif t <= 9.5e+62: tmp = math.log(y) * (-1.0 + x) else: tmp = (y * -z) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -13200000000.0) tmp = Float64(Float64(Float64(Float64(y * y) * Float64(0.5 + Float64(z * -0.5))) - Float64(y * Float64(z + -1.0))) - t); elseif (t <= 9.5e+62) tmp = Float64(log(y) * Float64(-1.0 + x)); else tmp = Float64(Float64(y * Float64(-z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -13200000000.0) tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t; elseif (t <= 9.5e+62) tmp = log(y) * (-1.0 + x); else tmp = (y * -z) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -13200000000.0], N[(N[(N[(N[(y * y), $MachinePrecision] * N[(0.5 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 9.5e+62], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -13200000000:\\
\;\;\;\;\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+62}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\end{array}
\end{array}
if t < -1.32e10Initial program 93.5%
associate--l+93.5%
+-commutative93.5%
associate-+l-93.5%
*-commutative93.5%
*-commutative93.5%
sub-neg93.5%
metadata-eval93.5%
sub-neg93.5%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 79.1%
Taylor expanded in y around 0 79.1%
mul-1-neg79.1%
unsub-neg79.1%
associate-*r*79.1%
sub-neg79.1%
metadata-eval79.1%
+-commutative79.1%
distribute-lft-in79.1%
metadata-eval79.1%
unpow279.1%
*-commutative79.1%
sub-neg79.1%
metadata-eval79.1%
+-commutative79.1%
Simplified79.1%
if -1.32e10 < t < 9.5000000000000003e62Initial program 87.8%
associate--l+87.8%
+-commutative87.8%
associate-+l-87.8%
*-commutative87.8%
*-commutative87.8%
sub-neg87.8%
metadata-eval87.8%
sub-neg87.8%
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 86.4%
mul-1-neg86.4%
+-commutative86.4%
fma-def86.4%
Simplified86.4%
Taylor expanded in t around 0 83.3%
if 9.5000000000000003e62 < t Initial program 93.6%
associate--l+93.6%
+-commutative93.6%
associate-+l-93.6%
*-commutative93.6%
*-commutative93.6%
sub-neg93.6%
metadata-eval93.6%
sub-neg93.6%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 81.6%
Taylor expanded in y around 0 81.6%
mul-1-neg81.6%
distribute-rgt-neg-in81.6%
sub-neg81.6%
metadata-eval81.6%
+-commutative81.6%
Simplified81.6%
Taylor expanded in z around inf 81.6%
associate-*r*81.6%
mul-1-neg81.6%
Simplified81.6%
Final simplification81.8%
(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 90.6%
Taylor expanded in y around 0 89.7%
Final simplification89.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.00075) (not (<= t 2.05e-8))) (- (- (* (* y y) (+ 0.5 (* z -0.5))) (* y (+ z -1.0))) t) (- (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.00075) || !(t <= 2.05e-8)) {
tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - 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 <= (-0.00075d0)) .or. (.not. (t <= 2.05d-8))) then
tmp = (((y * y) * (0.5d0 + (z * (-0.5d0)))) - (y * (z + (-1.0d0)))) - 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 <= -0.00075) || !(t <= 2.05e-8)) {
tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
} else {
tmp = -Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -0.00075) or not (t <= 2.05e-8): tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t else: tmp = -math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -0.00075) || !(t <= 2.05e-8)) tmp = Float64(Float64(Float64(Float64(y * y) * Float64(0.5 + Float64(z * -0.5))) - Float64(y * Float64(z + -1.0))) - t); else tmp = Float64(-log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -0.00075) || ~((t <= 2.05e-8))) tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t; else tmp = -log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -0.00075], N[Not[LessEqual[t, 2.05e-8]], $MachinePrecision]], N[(N[(N[(N[(y * y), $MachinePrecision] * N[(0.5 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], (-N[Log[y], $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.00075 \lor \neg \left(t \leq 2.05 \cdot 10^{-8}\right):\\
\;\;\;\;\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;-\log y\\
\end{array}
\end{array}
if t < -7.5000000000000002e-4 or 2.05000000000000016e-8 < t Initial program 92.6%
associate--l+92.6%
+-commutative92.6%
associate-+l-92.6%
*-commutative92.6%
*-commutative92.6%
sub-neg92.6%
metadata-eval92.6%
sub-neg92.6%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 76.0%
Taylor expanded in y around 0 76.0%
mul-1-neg76.0%
unsub-neg76.0%
associate-*r*76.0%
sub-neg76.0%
metadata-eval76.0%
+-commutative76.0%
distribute-lft-in76.0%
metadata-eval76.0%
unpow276.0%
*-commutative76.0%
sub-neg76.0%
metadata-eval76.0%
+-commutative76.0%
Simplified76.0%
if -7.5000000000000002e-4 < t < 2.05000000000000016e-8Initial program 88.2%
associate--l+88.2%
+-commutative88.2%
associate-+l-88.2%
*-commutative88.2%
*-commutative88.2%
sub-neg88.2%
metadata-eval88.2%
sub-neg88.2%
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 87.2%
mul-1-neg87.2%
+-commutative87.2%
fma-def87.2%
Simplified87.2%
Taylor expanded in t around 0 86.2%
Taylor expanded in x around 0 40.5%
Final simplification59.7%
(FPCore (x y z t) :precision binary64 (- (- (* (* y y) (+ 0.5 (* z -0.5))) (* y (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return (((y * y) * (0.5 + (z * -0.5))) - (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 * y) * (0.5d0 + (z * (-0.5d0)))) - (y * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
}
def code(x, y, z, t): return (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(y * y) * Float64(0.5 + Float64(z * -0.5))) - Float64(y * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(y * y), $MachinePrecision] * N[(0.5 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 90.6%
associate--l+90.6%
+-commutative90.6%
associate-+l-90.6%
*-commutative90.6%
*-commutative90.6%
sub-neg90.6%
metadata-eval90.6%
sub-neg90.6%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 48.0%
Taylor expanded in y around 0 48.0%
mul-1-neg48.0%
unsub-neg48.0%
associate-*r*48.0%
sub-neg48.0%
metadata-eval48.0%
+-commutative48.0%
distribute-lft-in48.0%
metadata-eval48.0%
unpow248.0%
*-commutative48.0%
sub-neg48.0%
metadata-eval48.0%
+-commutative48.0%
Simplified48.0%
Final simplification48.0%
(FPCore (x y z t) :precision binary64 (- (- y (* z y)) t))
double code(double x, double y, double z, double t) {
return (y - (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 = (y - (z * y)) - t
end function
public static double code(double x, double y, double z, double t) {
return (y - (z * y)) - t;
}
def code(x, y, z, t): return (y - (z * y)) - t
function code(x, y, z, t) return Float64(Float64(y - Float64(z * y)) - t) end
function tmp = code(x, y, z, t) tmp = (y - (z * y)) - t; end
code[x_, y_, z_, t_] := N[(N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(y - z \cdot y\right) - t
\end{array}
Initial program 90.6%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
sub-neg99.4%
metadata-eval99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 65.4%
mul-1-neg65.4%
unsub-neg65.4%
Simplified65.4%
Taylor expanded in y around inf 47.7%
sub-neg47.7%
distribute-lft-in47.7%
*-rgt-identity47.7%
distribute-rgt-neg-in47.7%
unsub-neg47.7%
Simplified47.7%
Final simplification47.7%
(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 90.6%
associate--l+90.6%
+-commutative90.6%
associate-+l-90.6%
*-commutative90.6%
*-commutative90.6%
sub-neg90.6%
metadata-eval90.6%
sub-neg90.6%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 48.0%
Taylor expanded in y around 0 47.7%
mul-1-neg47.7%
distribute-rgt-neg-in47.7%
sub-neg47.7%
metadata-eval47.7%
+-commutative47.7%
Simplified47.7%
Taylor expanded in z around inf 47.5%
associate-*r*47.5%
mul-1-neg47.5%
Simplified47.5%
Final simplification47.5%
(FPCore (x y z t) :precision binary64 (- y t))
double code(double x, double y, double z, double t) {
return y - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y - t
end function
public static double code(double x, double y, double z, double t) {
return y - t;
}
def code(x, y, z, t): return y - t
function code(x, y, z, t) return Float64(y - t) end
function tmp = code(x, y, z, t) tmp = y - t; end
code[x_, y_, z_, t_] := N[(y - t), $MachinePrecision]
\begin{array}{l}
\\
y - t
\end{array}
Initial program 90.6%
associate--l+90.6%
+-commutative90.6%
associate-+l-90.6%
*-commutative90.6%
*-commutative90.6%
sub-neg90.6%
metadata-eval90.6%
sub-neg90.6%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 48.0%
Taylor expanded in y around 0 47.7%
mul-1-neg47.7%
distribute-rgt-neg-in47.7%
sub-neg47.7%
metadata-eval47.7%
+-commutative47.7%
Simplified47.7%
Taylor expanded in z around 0 39.0%
Final simplification39.0%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t
end function
public static double code(double x, double y, double z, double t) {
return -t;
}
def code(x, y, z, t): return -t
function code(x, y, z, t) return Float64(-t) end
function tmp = code(x, y, z, t) tmp = -t; end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 90.6%
associate--l+90.6%
+-commutative90.6%
associate-+l-90.6%
*-commutative90.6%
*-commutative90.6%
sub-neg90.6%
metadata-eval90.6%
sub-neg90.6%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 38.7%
neg-mul-138.7%
Simplified38.7%
Final simplification38.7%
herbie shell --seed 2023214
(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))