
(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.2%
associate--l+90.2%
+-commutative90.2%
associate-+l-90.2%
*-commutative90.2%
*-commutative90.2%
sub-neg90.2%
metadata-eval90.2%
sub-neg90.2%
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 (- (- (fma (log y) (+ -1.0 x) (* (* y y) (+ 0.5 (* z -0.5)))) (* y (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return (fma(log(y), (-1.0 + x), ((y * y) * (0.5 + (z * -0.5)))) - (y * (z + -1.0))) - t;
}
function code(x, y, z, t) return Float64(Float64(fma(log(y), Float64(-1.0 + x), Float64(Float64(y * y) * Float64(0.5 + Float64(z * -0.5)))) - Float64(y * Float64(z + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision] + N[(N[(y * y), $MachinePrecision] * N[(0.5 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(\log y, -1 + x, \left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right)\right) - y \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 90.2%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (+ z -1.0) (- (* y (* y -0.5)) y))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((z + -1.0) * ((y * (y * -0.5)) - 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 + (-1.0d0)) * ((y * (y * (-0.5d0))) - y))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * ((y * (y * -0.5)) - y))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * ((y * (y * -0.5)) - y))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(Float64(y * Float64(y * -0.5)) - y))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * ((y * (y * -0.5)) - y))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(N[(y * N[(y * -0.5), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right) - y\right)\right) - t
\end{array}
Initial program 90.2%
Taylor expanded in y around 0 99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
unpow299.6%
associate-*l*99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -1.0) (not (<= (+ -1.0 x) -0.99999999999975))) (- (* (log y) (+ -1.0 x)) t) (- (- (- y (* z y)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -1.0) || !((-1.0 + x) <= -0.99999999999975)) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = ((y - (z * y)) - log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((((-1.0d0) + x) <= (-1.0d0)) .or. (.not. (((-1.0d0) + x) <= (-0.99999999999975d0)))) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = ((y - (z * y)) - log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -1.0) || !((-1.0 + x) <= -0.99999999999975)) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = ((y - (z * y)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -1.0) or not ((-1.0 + x) <= -0.99999999999975): tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = ((y - (z * y)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -1.0) || !(Float64(-1.0 + x) <= -0.99999999999975)) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(Float64(y - Float64(z * y)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -1.0) || ~(((-1.0 + x) <= -0.99999999999975))) tmp = (log(y) * (-1.0 + x)) - t; else tmp = ((y - (z * y)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.99999999999975]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -1 \lor \neg \left(-1 + x \leq -0.99999999999975\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y - z \cdot y\right) - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -1 or -0.99999999999974998 < (-.f64 x 1) Initial program 90.5%
Taylor expanded in y around 0 89.0%
if -1 < (-.f64 x 1) < -0.99999999999974998Initial program 53.7%
Taylor expanded in y around 0 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 99.2%
distribute-lft-out99.2%
mul-1-neg99.2%
sub-neg99.2%
metadata-eval99.2%
*-commutative99.2%
distribute-neg-out99.2%
distribute-lft-neg-in99.2%
*-commutative99.2%
unsub-neg99.2%
*-commutative99.2%
+-commutative99.2%
distribute-rgt-in99.2%
neg-mul-199.2%
remove-double-neg99.2%
distribute-rgt-neg-in99.2%
*-commutative99.2%
unsub-neg99.2%
Simplified99.2%
Final simplification89.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= x -3.5e+171)
t_1
(if (<= x -5e+90)
(- (* z (- y)) t)
(if (<= x -5000000000000.0)
t_1
(if (<= x -6e-43)
(- (- y (* z y)) t)
(if (<= x -1e-66)
(- (log y))
(if (<= x 1950000.0)
(- (* (+ z -1.0) (- (* (* y y) -0.5) y)) t)
t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -3.5e+171) {
tmp = t_1;
} else if (x <= -5e+90) {
tmp = (z * -y) - t;
} else if (x <= -5000000000000.0) {
tmp = t_1;
} else if (x <= -6e-43) {
tmp = (y - (z * y)) - t;
} else if (x <= -1e-66) {
tmp = -log(y);
} else if (x <= 1950000.0) {
tmp = ((z + -1.0) * (((y * y) * -0.5) - 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 = log(y) * x
if (x <= (-3.5d+171)) then
tmp = t_1
else if (x <= (-5d+90)) then
tmp = (z * -y) - t
else if (x <= (-5000000000000.0d0)) then
tmp = t_1
else if (x <= (-6d-43)) then
tmp = (y - (z * y)) - t
else if (x <= (-1d-66)) then
tmp = -log(y)
else if (x <= 1950000.0d0) then
tmp = ((z + (-1.0d0)) * (((y * y) * (-0.5d0)) - 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 = Math.log(y) * x;
double tmp;
if (x <= -3.5e+171) {
tmp = t_1;
} else if (x <= -5e+90) {
tmp = (z * -y) - t;
} else if (x <= -5000000000000.0) {
tmp = t_1;
} else if (x <= -6e-43) {
tmp = (y - (z * y)) - t;
} else if (x <= -1e-66) {
tmp = -Math.log(y);
} else if (x <= 1950000.0) {
tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -3.5e+171: tmp = t_1 elif x <= -5e+90: tmp = (z * -y) - t elif x <= -5000000000000.0: tmp = t_1 elif x <= -6e-43: tmp = (y - (z * y)) - t elif x <= -1e-66: tmp = -math.log(y) elif x <= 1950000.0: tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -3.5e+171) tmp = t_1; elseif (x <= -5e+90) tmp = Float64(Float64(z * Float64(-y)) - t); elseif (x <= -5000000000000.0) tmp = t_1; elseif (x <= -6e-43) tmp = Float64(Float64(y - Float64(z * y)) - t); elseif (x <= -1e-66) tmp = Float64(-log(y)); elseif (x <= 1950000.0) tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(Float64(y * y) * -0.5) - y)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; tmp = 0.0; if (x <= -3.5e+171) tmp = t_1; elseif (x <= -5e+90) tmp = (z * -y) - t; elseif (x <= -5000000000000.0) tmp = t_1; elseif (x <= -6e-43) tmp = (y - (z * y)) - t; elseif (x <= -1e-66) tmp = -log(y); elseif (x <= 1950000.0) tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t; 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]}, If[LessEqual[x, -3.5e+171], t$95$1, If[LessEqual[x, -5e+90], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, -5000000000000.0], t$95$1, If[LessEqual[x, -6e-43], N[(N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, -1e-66], (-N[Log[y], $MachinePrecision]), If[LessEqual[x, 1950000.0], N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * -0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+171}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{+90}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\mathbf{elif}\;x \leq -5000000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-43}:\\
\;\;\;\;\left(y - z \cdot y\right) - t\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-66}:\\
\;\;\;\;-\log y\\
\mathbf{elif}\;x \leq 1950000:\\
\;\;\;\;\left(z + -1\right) \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.4999999999999999e171 or -5.0000000000000004e90 < x < -5e12 or 1.95e6 < x Initial program 96.0%
associate--l+96.0%
+-commutative96.0%
associate-+l-96.0%
*-commutative96.0%
*-commutative96.0%
sub-neg96.0%
metadata-eval96.0%
sub-neg96.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 76.9%
if -3.4999999999999999e171 < x < -5.0000000000000004e90Initial program 86.6%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 72.8%
associate-*r*72.8%
neg-mul-172.8%
Simplified72.8%
if -5e12 < x < -6.00000000000000007e-43Initial program 99.8%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 55.7%
sub-neg55.7%
metadata-eval55.7%
*-commutative55.7%
distribute-lft-in55.7%
*-commutative55.7%
neg-mul-155.7%
distribute-lft-in55.7%
neg-mul-155.7%
remove-double-neg55.7%
+-commutative55.7%
mul-1-neg55.7%
unsub-neg55.7%
Simplified55.7%
if -6.00000000000000007e-43 < x < -9.9999999999999998e-67Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around 0 100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
if -9.9999999999999998e-67 < x < 1.95e6Initial program 83.4%
Taylor expanded in y around 0 99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
unpow299.5%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in y around inf 71.7%
+-commutative71.7%
mul-1-neg71.7%
sub-neg71.7%
metadata-eval71.7%
*-commutative71.7%
associate-*r*71.7%
sub-neg71.7%
metadata-eval71.7%
distribute-rgt-neg-out71.7%
*-commutative71.7%
distribute-rgt-in71.7%
*-commutative71.7%
unpow271.7%
sub-neg71.7%
Simplified71.7%
Final simplification73.8%
(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 90.2%
Taylor expanded in y around 0 99.1%
mul-1-neg99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= x -3.5e+171)
t_1
(if (<= x -1.62e+90)
(- (* z (- y)) t)
(if (or (<= x -2.8e+14) (not (<= x 265000.0)))
t_1
(- (- t) (log y)))))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -3.5e+171) {
tmp = t_1;
} else if (x <= -1.62e+90) {
tmp = (z * -y) - t;
} else if ((x <= -2.8e+14) || !(x <= 265000.0)) {
tmp = t_1;
} else {
tmp = -t - log(y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = log(y) * x
if (x <= (-3.5d+171)) then
tmp = t_1
else if (x <= (-1.62d+90)) then
tmp = (z * -y) - t
else if ((x <= (-2.8d+14)) .or. (.not. (x <= 265000.0d0))) then
tmp = t_1
else
tmp = -t - log(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) * x;
double tmp;
if (x <= -3.5e+171) {
tmp = t_1;
} else if (x <= -1.62e+90) {
tmp = (z * -y) - t;
} else if ((x <= -2.8e+14) || !(x <= 265000.0)) {
tmp = t_1;
} else {
tmp = -t - Math.log(y);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -3.5e+171: tmp = t_1 elif x <= -1.62e+90: tmp = (z * -y) - t elif (x <= -2.8e+14) or not (x <= 265000.0): tmp = t_1 else: tmp = -t - math.log(y) return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -3.5e+171) tmp = t_1; elseif (x <= -1.62e+90) tmp = Float64(Float64(z * Float64(-y)) - t); elseif ((x <= -2.8e+14) || !(x <= 265000.0)) tmp = t_1; else tmp = Float64(Float64(-t) - log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; tmp = 0.0; if (x <= -3.5e+171) tmp = t_1; elseif (x <= -1.62e+90) tmp = (z * -y) - t; elseif ((x <= -2.8e+14) || ~((x <= 265000.0))) tmp = t_1; else tmp = -t - log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -3.5e+171], t$95$1, If[LessEqual[x, -1.62e+90], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[x, -2.8e+14], N[Not[LessEqual[x, 265000.0]], $MachinePrecision]], t$95$1, N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+171}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.62 \cdot 10^{+90}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{+14} \lor \neg \left(x \leq 265000\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - \log y\\
\end{array}
\end{array}
if x < -3.4999999999999999e171 or -1.62e90 < x < -2.8e14 or 265000 < x Initial program 96.0%
associate--l+96.0%
+-commutative96.0%
associate-+l-96.0%
*-commutative96.0%
*-commutative96.0%
sub-neg96.0%
metadata-eval96.0%
sub-neg96.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 76.9%
if -3.4999999999999999e171 < x < -1.62e90Initial program 86.6%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 72.8%
associate-*r*72.8%
neg-mul-172.8%
Simplified72.8%
if -2.8e14 < x < 265000Initial program 86.1%
Taylor expanded in y around 0 84.5%
Taylor expanded in x around 0 82.3%
neg-mul-182.3%
Simplified82.3%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (<= y 3.4e-31) (- (* (log y) (+ -1.0 x)) t) (- (* (log1p (- y)) (+ z -1.0)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.4e-31) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = (log1p(-y) * (z + -1.0)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.4e-31) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = (Math.log1p(-y) * (z + -1.0)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.4e-31: tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = (math.log1p(-y) * (z + -1.0)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.4e-31) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(log1p(Float64(-y)) * Float64(z + -1.0)) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.4e-31], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{-31}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) - t\\
\end{array}
\end{array}
if y < 3.4000000000000001e-31Initial program 92.0%
Taylor expanded in y around 0 92.0%
if 3.4000000000000001e-31 < y Initial program 74.8%
associate--l+74.8%
+-commutative74.8%
associate-+l-74.8%
*-commutative74.8%
*-commutative74.8%
sub-neg74.8%
metadata-eval74.8%
sub-neg74.8%
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 78.4%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7e+14) (not (<= t 240.0))) (- (* (log y) x) t) (* (log y) (+ -1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7e+14) || !(t <= 240.0)) {
tmp = (log(y) * x) - t;
} else {
tmp = log(y) * (-1.0 + x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-7d+14)) .or. (.not. (t <= 240.0d0))) then
tmp = (log(y) * x) - t
else
tmp = log(y) * ((-1.0d0) + x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7e+14) || !(t <= 240.0)) {
tmp = (Math.log(y) * x) - t;
} else {
tmp = Math.log(y) * (-1.0 + x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7e+14) or not (t <= 240.0): tmp = (math.log(y) * x) - t else: tmp = math.log(y) * (-1.0 + x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7e+14) || !(t <= 240.0)) tmp = Float64(Float64(log(y) * x) - t); else tmp = Float64(log(y) * Float64(-1.0 + x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -7e+14) || ~((t <= 240.0))) tmp = (log(y) * x) - t; else tmp = log(y) * (-1.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7e+14], N[Not[LessEqual[t, 240.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+14} \lor \neg \left(t \leq 240\right):\\
\;\;\;\;\log y \cdot x - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\end{array}
\end{array}
if t < -7e14 or 240 < t Initial program 96.2%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
unpow299.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 95.9%
if -7e14 < t < 240Initial program 84.6%
Taylor expanded in y around 0 82.0%
fma-neg82.0%
sub-neg82.0%
metadata-eval82.0%
Applied egg-rr82.0%
Taylor expanded in t around 0 80.6%
Final simplification88.0%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.6e+20)
(- (* z (- y)) t)
(if (<= t 1.95e+64)
(* (log y) (+ -1.0 x))
(- (* (+ z -1.0) (- (* (* y y) -0.5) y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.6e+20) {
tmp = (z * -y) - t;
} else if (t <= 1.95e+64) {
tmp = log(y) * (-1.0 + x);
} else {
tmp = ((z + -1.0) * (((y * y) * -0.5) - 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 (t <= (-2.6d+20)) then
tmp = (z * -y) - t
else if (t <= 1.95d+64) then
tmp = log(y) * ((-1.0d0) + x)
else
tmp = ((z + (-1.0d0)) * (((y * y) * (-0.5d0)) - y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.6e+20) {
tmp = (z * -y) - t;
} else if (t <= 1.95e+64) {
tmp = Math.log(y) * (-1.0 + x);
} else {
tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.6e+20: tmp = (z * -y) - t elif t <= 1.95e+64: tmp = math.log(y) * (-1.0 + x) else: tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.6e+20) tmp = Float64(Float64(z * Float64(-y)) - t); elseif (t <= 1.95e+64) tmp = Float64(log(y) * Float64(-1.0 + x)); else tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(Float64(y * y) * -0.5) - y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.6e+20) tmp = (z * -y) - t; elseif (t <= 1.95e+64) tmp = log(y) * (-1.0 + x); else tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.6e+20], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 1.95e+64], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * -0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+20}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+64}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + -1\right) \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t\\
\end{array}
\end{array}
if t < -2.6e20Initial program 98.2%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 78.9%
associate-*r*78.9%
neg-mul-178.9%
Simplified78.9%
if -2.6e20 < t < 1.9499999999999999e64Initial program 85.3%
Taylor expanded in y around 0 82.9%
fma-neg83.0%
sub-neg83.0%
metadata-eval83.0%
Applied egg-rr83.0%
Taylor expanded in t around 0 78.3%
if 1.9499999999999999e64 < t Initial program 95.0%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
unpow299.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around inf 87.1%
+-commutative87.1%
mul-1-neg87.1%
sub-neg87.1%
metadata-eval87.1%
*-commutative87.1%
associate-*r*87.1%
sub-neg87.1%
metadata-eval87.1%
distribute-rgt-neg-out87.1%
*-commutative87.1%
distribute-rgt-in87.1%
*-commutative87.1%
unpow287.1%
sub-neg87.1%
Simplified87.1%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (<= y 2.9e-31) (- (* (log y) (+ -1.0 x)) t) (- (* (+ z -1.0) (- (* (* y y) -0.5) y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.9e-31) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = ((z + -1.0) * (((y * y) * -0.5) - 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 (y <= 2.9d-31) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = ((z + (-1.0d0)) * (((y * y) * (-0.5d0)) - y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.9e-31) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.9e-31: tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.9e-31) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(Float64(y * y) * -0.5) - y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.9e-31) tmp = (log(y) * (-1.0 + x)) - t; else tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.9e-31], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * -0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.9 \cdot 10^{-31}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(z + -1\right) \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t\\
\end{array}
\end{array}
if y < 2.9000000000000001e-31Initial program 92.0%
Taylor expanded in y around 0 92.0%
if 2.9000000000000001e-31 < y Initial program 74.8%
Taylor expanded in y around 0 96.9%
mul-1-neg96.9%
unsub-neg96.9%
*-commutative96.9%
unpow296.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in y around inf 77.5%
+-commutative77.5%
mul-1-neg77.5%
sub-neg77.5%
metadata-eval77.5%
*-commutative77.5%
associate-*r*77.5%
sub-neg77.5%
metadata-eval77.5%
distribute-rgt-neg-out77.5%
*-commutative77.5%
distribute-rgt-in77.5%
*-commutative77.5%
unpow277.5%
sub-neg77.5%
Simplified77.5%
Final simplification90.5%
(FPCore (x y z t) :precision binary64 (if (<= t -5.8e-21) (- (* z (- y)) t) (if (<= t 30.5) (- (log y)) (- (* (+ z -1.0) (- (* (* y y) -0.5) y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.8e-21) {
tmp = (z * -y) - t;
} else if (t <= 30.5) {
tmp = -log(y);
} else {
tmp = ((z + -1.0) * (((y * y) * -0.5) - 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 (t <= (-5.8d-21)) then
tmp = (z * -y) - t
else if (t <= 30.5d0) then
tmp = -log(y)
else
tmp = ((z + (-1.0d0)) * (((y * y) * (-0.5d0)) - y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.8e-21) {
tmp = (z * -y) - t;
} else if (t <= 30.5) {
tmp = -Math.log(y);
} else {
tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.8e-21: tmp = (z * -y) - t elif t <= 30.5: tmp = -math.log(y) else: tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.8e-21) tmp = Float64(Float64(z * Float64(-y)) - t); elseif (t <= 30.5) tmp = Float64(-log(y)); else tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(Float64(y * y) * -0.5) - y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.8e-21) tmp = (z * -y) - t; elseif (t <= 30.5) tmp = -log(y); else tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.8e-21], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 30.5], (-N[Log[y], $MachinePrecision]), N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * -0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-21}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\mathbf{elif}\;t \leq 30.5:\\
\;\;\;\;-\log y\\
\mathbf{else}:\\
\;\;\;\;\left(z + -1\right) \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t\\
\end{array}
\end{array}
if t < -5.8e-21Initial program 97.2%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 65.1%
associate-*r*65.1%
neg-mul-165.1%
Simplified65.1%
if -5.8e-21 < t < 30.5Initial program 83.7%
Taylor expanded in y around 0 80.8%
Taylor expanded in x around 0 37.3%
neg-mul-137.3%
Simplified37.3%
Taylor expanded in t around 0 36.2%
if 30.5 < t Initial program 94.3%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
unpow299.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around inf 80.1%
+-commutative80.1%
mul-1-neg80.1%
sub-neg80.1%
metadata-eval80.1%
*-commutative80.1%
associate-*r*80.1%
sub-neg80.1%
metadata-eval80.1%
distribute-rgt-neg-out80.1%
*-commutative80.1%
distribute-rgt-in80.1%
*-commutative80.1%
unpow280.1%
sub-neg80.1%
Simplified80.1%
Final simplification55.6%
(FPCore (x y z t) :precision binary64 (- (* (+ z -1.0) (- (* (* y y) -0.5) y)) t))
double code(double x, double y, double z, double t) {
return ((z + -1.0) * (((y * y) * -0.5) - 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 = ((z + (-1.0d0)) * (((y * y) * (-0.5d0)) - y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((z + -1.0) * (((y * y) * -0.5) - y)) - t;
}
def code(x, y, z, t): return ((z + -1.0) * (((y * y) * -0.5) - y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(z + -1.0) * Float64(Float64(Float64(y * y) * -0.5) - y)) - t) end
function tmp = code(x, y, z, t) tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * -0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(z + -1\right) \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t
\end{array}
Initial program 90.2%
Taylor expanded in y around 0 99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
unpow299.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around inf 48.6%
+-commutative48.6%
mul-1-neg48.6%
sub-neg48.6%
metadata-eval48.6%
*-commutative48.6%
associate-*r*48.6%
sub-neg48.6%
metadata-eval48.6%
distribute-rgt-neg-out48.6%
*-commutative48.6%
distribute-rgt-in48.6%
*-commutative48.6%
unpow248.6%
sub-neg48.6%
Simplified48.6%
Final simplification48.6%
(FPCore (x y z t) :precision binary64 (- (* z (- (* (* y y) -0.5) y)) t))
double code(double x, double y, double z, double t) {
return (z * (((y * y) * -0.5) - 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 = (z * (((y * y) * (-0.5d0)) - y)) - t
end function
public static double code(double x, double y, double z, double t) {
return (z * (((y * y) * -0.5) - y)) - t;
}
def code(x, y, z, t): return (z * (((y * y) * -0.5) - y)) - t
function code(x, y, z, t) return Float64(Float64(z * Float64(Float64(Float64(y * y) * -0.5) - y)) - t) end
function tmp = code(x, y, z, t) tmp = (z * (((y * y) * -0.5) - y)) - t; end
code[x_, y_, z_, t_] := N[(N[(z * N[(N[(N[(y * y), $MachinePrecision] * -0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t
\end{array}
Initial program 90.2%
Taylor expanded in y around 0 99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
unpow299.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in z around inf 48.5%
*-commutative48.5%
unpow248.5%
Simplified48.5%
Final simplification48.5%
(FPCore (x y z t) :precision binary64 (if (<= t -0.0006) (- t) (if (<= t 9000.0) (* z (- y)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.0006) {
tmp = -t;
} else if (t <= 9000.0) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-0.0006d0)) then
tmp = -t
else if (t <= 9000.0d0) then
tmp = z * -y
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.0006) {
tmp = -t;
} else if (t <= 9000.0) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -0.0006: tmp = -t elif t <= 9000.0: tmp = z * -y else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -0.0006) tmp = Float64(-t); elseif (t <= 9000.0) tmp = Float64(z * Float64(-y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -0.0006) tmp = -t; elseif (t <= 9000.0) tmp = z * -y; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -0.0006], (-t), If[LessEqual[t, 9000.0], N[(z * (-y)), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0006:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 9000:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -5.99999999999999947e-4 or 9e3 < t Initial program 97.1%
associate--l+97.1%
+-commutative97.1%
associate-+l-97.1%
*-commutative97.1%
*-commutative97.1%
sub-neg97.1%
metadata-eval97.1%
sub-neg97.1%
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 70.8%
mul-1-neg70.8%
Simplified70.8%
if -5.99999999999999947e-4 < t < 9e3Initial program 82.9%
Taylor expanded in y around 0 98.3%
mul-1-neg98.3%
Simplified98.3%
Taylor expanded in z around inf 20.7%
associate-*r*20.7%
neg-mul-120.7%
Simplified20.7%
Taylor expanded in y around inf 20.5%
associate-*r*20.5%
neg-mul-120.5%
*-commutative20.5%
Simplified20.5%
Final simplification46.4%
(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.2%
Taylor expanded in y around 0 99.1%
mul-1-neg99.1%
Simplified99.1%
Taylor expanded in y around inf 48.2%
sub-neg48.2%
metadata-eval48.2%
*-commutative48.2%
distribute-lft-in48.2%
*-commutative48.2%
neg-mul-148.2%
distribute-lft-in48.2%
neg-mul-148.2%
remove-double-neg48.2%
+-commutative48.2%
mul-1-neg48.2%
unsub-neg48.2%
Simplified48.2%
Final simplification48.2%
(FPCore (x y z t) :precision binary64 (- (* z (- y)) t))
double code(double x, double y, double z, double t) {
return (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 = (z * -y) - t
end function
public static double code(double x, double y, double z, double t) {
return (z * -y) - t;
}
def code(x, y, z, t): return (z * -y) - t
function code(x, y, z, t) return Float64(Float64(z * Float64(-y)) - t) end
function tmp = code(x, y, z, t) tmp = (z * -y) - t; end
code[x_, y_, z_, t_] := N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(-y\right) - t
\end{array}
Initial program 90.2%
Taylor expanded in y around 0 99.1%
mul-1-neg99.1%
Simplified99.1%
Taylor expanded in z around inf 48.1%
associate-*r*48.1%
neg-mul-148.1%
Simplified48.1%
Final simplification48.1%
(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.2%
associate--l+90.2%
+-commutative90.2%
associate-+l-90.2%
*-commutative90.2%
*-commutative90.2%
sub-neg90.2%
metadata-eval90.2%
sub-neg90.2%
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.0%
mul-1-neg38.0%
Simplified38.0%
Final simplification38.0%
herbie shell --seed 2023238
(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))