
(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 19 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)) (fma (+ -1.0 x) (log y) (- t))))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), fma((-1.0 + x), log(y), -t));
}
function code(x, y, z, t) return fma(Float64(z + -1.0), log1p(Float64(-y)), fma(Float64(-1.0 + x), log(y), Float64(-t))) end
code[x_, y_, z_, t_] := N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \mathsf{fma}\left(-1 + x, \log y, -t\right)\right)
\end{array}
Initial program 86.8%
sub-neg86.8%
+-commutative86.8%
associate-+l+86.8%
fma-define86.8%
sub-neg86.8%
metadata-eval86.8%
sub-neg86.8%
log1p-define99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (fma (+ -1.0 x) (log y) (* (log1p (- y)) (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return fma((-1.0 + x), log(y), (log1p(-y) * (z + -1.0))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(-1.0 + x), log(y), Float64(log1p(Float64(-y)) * Float64(z + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-1 + x, \log y, \mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 86.8%
fma-define86.8%
sub-neg86.8%
metadata-eval86.8%
sub-neg86.8%
metadata-eval86.8%
sub-neg86.8%
log1p-define99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (+ -1.0 x) (log y))
(*
(+ z -1.0)
(* y (+ -1.0 (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5))))))
t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((((-1.0d0) + x) * log(y)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * ((y * ((y * (-0.25d0)) - 0.3333333333333333d0)) - 0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * Float64(Float64(y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * N[(N[(y * N[(N[(y * -0.25), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 86.8%
Taylor expanded in y around 0 99.3%
Final simplification99.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* y (- 1.0 z)) t)) (t_2 (- (* x (log y)) t)))
(if (<= x -2.8e+30)
t_2
(if (<= x -1.75e-51)
t_1
(if (<= x 4.2e-227) (- (- t) (log y)) (if (<= x 3.3e+24) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * (1.0 - z)) - t;
double t_2 = (x * log(y)) - t;
double tmp;
if (x <= -2.8e+30) {
tmp = t_2;
} else if (x <= -1.75e-51) {
tmp = t_1;
} else if (x <= 4.2e-227) {
tmp = -t - log(y);
} else if (x <= 3.3e+24) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * (1.0d0 - z)) - t
t_2 = (x * log(y)) - t
if (x <= (-2.8d+30)) then
tmp = t_2
else if (x <= (-1.75d-51)) then
tmp = t_1
else if (x <= 4.2d-227) then
tmp = -t - log(y)
else if (x <= 3.3d+24) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y * (1.0 - z)) - t;
double t_2 = (x * Math.log(y)) - t;
double tmp;
if (x <= -2.8e+30) {
tmp = t_2;
} else if (x <= -1.75e-51) {
tmp = t_1;
} else if (x <= 4.2e-227) {
tmp = -t - Math.log(y);
} else if (x <= 3.3e+24) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * (1.0 - z)) - t t_2 = (x * math.log(y)) - t tmp = 0 if x <= -2.8e+30: tmp = t_2 elif x <= -1.75e-51: tmp = t_1 elif x <= 4.2e-227: tmp = -t - math.log(y) elif x <= 3.3e+24: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * Float64(1.0 - z)) - t) t_2 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -2.8e+30) tmp = t_2; elseif (x <= -1.75e-51) tmp = t_1; elseif (x <= 4.2e-227) tmp = Float64(Float64(-t) - log(y)); elseif (x <= 3.3e+24) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * (1.0 - z)) - t; t_2 = (x * log(y)) - t; tmp = 0.0; if (x <= -2.8e+30) tmp = t_2; elseif (x <= -1.75e-51) tmp = t_1; elseif (x <= 4.2e-227) tmp = -t - log(y); elseif (x <= 3.3e+24) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -2.8e+30], t$95$2, If[LessEqual[x, -1.75e-51], t$95$1, If[LessEqual[x, 4.2e-227], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+24], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - z\right) - t\\
t_2 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-227}:\\
\;\;\;\;\left(-t\right) - \log y\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.79999999999999983e30 or 3.2999999999999999e24 < x Initial program 98.4%
Taylor expanded in y around 0 99.6%
Taylor expanded in y around 0 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in x around inf 97.2%
*-commutative97.2%
Simplified97.2%
if -2.79999999999999983e30 < x < -1.7499999999999999e-51 or 4.1999999999999999e-227 < x < 3.2999999999999999e24Initial program 71.8%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
mul-1-neg99.4%
unsub-neg99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 99.4%
associate--l+99.4%
mul-1-neg99.4%
log-rec99.4%
sub-neg99.4%
metadata-eval99.4%
associate-/l*99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in y around inf 81.2%
if -1.7499999999999999e-51 < x < 4.1999999999999999e-227Initial program 80.4%
Taylor expanded in x around 0 80.4%
+-commutative80.4%
mul-1-neg80.4%
unsub-neg80.4%
sub-neg80.4%
metadata-eval80.4%
+-commutative80.4%
sub-neg80.4%
log1p-define99.9%
Simplified99.9%
Taylor expanded in y around 0 76.3%
mul-1-neg76.3%
distribute-neg-in76.3%
unsub-neg76.3%
Simplified76.3%
Final simplification87.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* y (- 1.0 z)) t)) (t_2 (- (* x (log y)) t)))
(if (<= x -2.8e+30)
t_2
(if (<= x -5.5e-52)
t_1
(if (<= x 4.1e-227) (- (- y (log y)) t) (if (<= x 3.3e+24) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * (1.0 - z)) - t;
double t_2 = (x * log(y)) - t;
double tmp;
if (x <= -2.8e+30) {
tmp = t_2;
} else if (x <= -5.5e-52) {
tmp = t_1;
} else if (x <= 4.1e-227) {
tmp = (y - log(y)) - t;
} else if (x <= 3.3e+24) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * (1.0d0 - z)) - t
t_2 = (x * log(y)) - t
if (x <= (-2.8d+30)) then
tmp = t_2
else if (x <= (-5.5d-52)) then
tmp = t_1
else if (x <= 4.1d-227) then
tmp = (y - log(y)) - t
else if (x <= 3.3d+24) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y * (1.0 - z)) - t;
double t_2 = (x * Math.log(y)) - t;
double tmp;
if (x <= -2.8e+30) {
tmp = t_2;
} else if (x <= -5.5e-52) {
tmp = t_1;
} else if (x <= 4.1e-227) {
tmp = (y - Math.log(y)) - t;
} else if (x <= 3.3e+24) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * (1.0 - z)) - t t_2 = (x * math.log(y)) - t tmp = 0 if x <= -2.8e+30: tmp = t_2 elif x <= -5.5e-52: tmp = t_1 elif x <= 4.1e-227: tmp = (y - math.log(y)) - t elif x <= 3.3e+24: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * Float64(1.0 - z)) - t) t_2 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -2.8e+30) tmp = t_2; elseif (x <= -5.5e-52) tmp = t_1; elseif (x <= 4.1e-227) tmp = Float64(Float64(y - log(y)) - t); elseif (x <= 3.3e+24) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * (1.0 - z)) - t; t_2 = (x * log(y)) - t; tmp = 0.0; if (x <= -2.8e+30) tmp = t_2; elseif (x <= -5.5e-52) tmp = t_1; elseif (x <= 4.1e-227) tmp = (y - log(y)) - t; elseif (x <= 3.3e+24) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -2.8e+30], t$95$2, If[LessEqual[x, -5.5e-52], t$95$1, If[LessEqual[x, 4.1e-227], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 3.3e+24], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - z\right) - t\\
t_2 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-227}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.79999999999999983e30 or 3.2999999999999999e24 < x Initial program 98.4%
Taylor expanded in y around 0 99.6%
Taylor expanded in y around 0 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in x around inf 97.2%
*-commutative97.2%
Simplified97.2%
if -2.79999999999999983e30 < x < -5.5e-52 or 4.10000000000000009e-227 < x < 3.2999999999999999e24Initial program 71.8%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
mul-1-neg99.4%
unsub-neg99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 99.4%
associate--l+99.4%
mul-1-neg99.4%
log-rec99.4%
sub-neg99.4%
metadata-eval99.4%
associate-/l*99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in y around inf 81.2%
if -5.5e-52 < x < 4.10000000000000009e-227Initial program 80.4%
Taylor expanded in y around 0 96.7%
+-commutative96.7%
sub-neg96.7%
metadata-eval96.7%
mul-1-neg96.7%
unsub-neg96.7%
+-commutative96.7%
sub-neg96.7%
metadata-eval96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in z around 0 76.4%
sub-neg76.4%
metadata-eval76.4%
+-commutative76.4%
neg-mul-176.4%
unsub-neg76.4%
Simplified76.4%
Taylor expanded in x around 0 76.4%
neg-mul-176.4%
unsub-neg76.4%
Simplified76.4%
Final simplification87.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (* y (- 1.0 z)) t)))
(if (<= x -1.06e+67)
t_1
(if (<= x -4.8e-53)
t_2
(if (<= x 4.2e-227) (- (- t) (log y)) (if (<= x 6.6e+107) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = (y * (1.0 - z)) - t;
double tmp;
if (x <= -1.06e+67) {
tmp = t_1;
} else if (x <= -4.8e-53) {
tmp = t_2;
} else if (x <= 4.2e-227) {
tmp = -t - log(y);
} else if (x <= 6.6e+107) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = (y * (1.0d0 - z)) - t
if (x <= (-1.06d+67)) then
tmp = t_1
else if (x <= (-4.8d-53)) then
tmp = t_2
else if (x <= 4.2d-227) then
tmp = -t - log(y)
else if (x <= 6.6d+107) 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 = x * Math.log(y);
double t_2 = (y * (1.0 - z)) - t;
double tmp;
if (x <= -1.06e+67) {
tmp = t_1;
} else if (x <= -4.8e-53) {
tmp = t_2;
} else if (x <= 4.2e-227) {
tmp = -t - Math.log(y);
} else if (x <= 6.6e+107) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = (y * (1.0 - z)) - t tmp = 0 if x <= -1.06e+67: tmp = t_1 elif x <= -4.8e-53: tmp = t_2 elif x <= 4.2e-227: tmp = -t - math.log(y) elif x <= 6.6e+107: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(y * Float64(1.0 - z)) - t) tmp = 0.0 if (x <= -1.06e+67) tmp = t_1; elseif (x <= -4.8e-53) tmp = t_2; elseif (x <= 4.2e-227) tmp = Float64(Float64(-t) - log(y)); elseif (x <= 6.6e+107) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = (y * (1.0 - z)) - t; tmp = 0.0; if (x <= -1.06e+67) tmp = t_1; elseif (x <= -4.8e-53) tmp = t_2; elseif (x <= 4.2e-227) tmp = -t - log(y); elseif (x <= 6.6e+107) tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -1.06e+67], t$95$1, If[LessEqual[x, -4.8e-53], t$95$2, If[LessEqual[x, 4.2e-227], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.6e+107], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := y \cdot \left(1 - z\right) - t\\
\mathbf{if}\;x \leq -1.06 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-53}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-227}:\\
\;\;\;\;\left(-t\right) - \log y\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{+107}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.0599999999999999e67 or 6.60000000000000064e107 < x Initial program 99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
sub-neg99.4%
log1p-define99.5%
Simplified99.5%
Taylor expanded in t around inf 71.2%
associate--l+71.2%
sub-neg71.2%
metadata-eval71.2%
associate-/l*71.2%
+-commutative71.2%
associate-/l*69.7%
sub-neg69.7%
metadata-eval69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in x around inf 75.0%
*-commutative75.0%
Simplified75.0%
if -1.0599999999999999e67 < x < -4.80000000000000015e-53 or 4.1999999999999999e-227 < x < 6.60000000000000064e107Initial program 77.7%
Taylor expanded in y around 0 98.3%
+-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
mul-1-neg98.3%
unsub-neg98.3%
+-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in y around inf 95.1%
associate--l+95.1%
mul-1-neg95.1%
log-rec95.1%
sub-neg95.1%
metadata-eval95.1%
associate-/l*95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in y around inf 77.5%
if -4.80000000000000015e-53 < x < 4.1999999999999999e-227Initial program 80.4%
Taylor expanded in x around 0 80.4%
+-commutative80.4%
mul-1-neg80.4%
unsub-neg80.4%
sub-neg80.4%
metadata-eval80.4%
+-commutative80.4%
sub-neg80.4%
log1p-define99.9%
Simplified99.9%
Taylor expanded in y around 0 76.3%
mul-1-neg76.3%
distribute-neg-in76.3%
unsub-neg76.3%
Simplified76.3%
Final simplification76.2%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -4e+44)
(- (* x (log y)) t)
(if (<= (+ -1.0 x) -0.5)
(- (- (* y (- 1.0 z)) (log y)) t)
(- (* (+ -1.0 x) (log y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -4e+44) {
tmp = (x * log(y)) - t;
} else if ((-1.0 + x) <= -0.5) {
tmp = ((y * (1.0 - z)) - log(y)) - t;
} else {
tmp = ((-1.0 + x) * log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((-1.0d0) + x) <= (-4d+44)) then
tmp = (x * log(y)) - t
else if (((-1.0d0) + x) <= (-0.5d0)) then
tmp = ((y * (1.0d0 - z)) - log(y)) - t
else
tmp = (((-1.0d0) + x) * log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -4e+44) {
tmp = (x * Math.log(y)) - t;
} else if ((-1.0 + x) <= -0.5) {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
} else {
tmp = ((-1.0 + x) * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -4e+44: tmp = (x * math.log(y)) - t elif (-1.0 + x) <= -0.5: tmp = ((y * (1.0 - z)) - math.log(y)) - t else: tmp = ((-1.0 + x) * math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -4e+44) tmp = Float64(Float64(x * log(y)) - t); elseif (Float64(-1.0 + x) <= -0.5) tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); else tmp = Float64(Float64(Float64(-1.0 + x) * log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -4e+44) tmp = (x * log(y)) - t; elseif ((-1.0 + x) <= -0.5) tmp = ((y * (1.0 - z)) - log(y)) - t; else tmp = ((-1.0 + x) * log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -4e+44], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.5], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -4 \cdot 10^{+44}:\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{elif}\;-1 + x \leq -0.5:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(-1 + x\right) \cdot \log y - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -4.0000000000000004e44Initial program 98.9%
Taylor expanded in y around 0 99.5%
Taylor expanded in y around 0 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x around inf 97.6%
*-commutative97.6%
Simplified97.6%
if -4.0000000000000004e44 < (-.f64 x #s(literal 1 binary64)) < -0.5Initial program 75.3%
Taylor expanded in x around 0 73.0%
+-commutative73.0%
mul-1-neg73.0%
unsub-neg73.0%
sub-neg73.0%
metadata-eval73.0%
+-commutative73.0%
sub-neg73.0%
log1p-define97.6%
Simplified97.6%
Taylor expanded in y around 0 95.7%
sub-neg95.7%
metadata-eval95.7%
neg-mul-195.7%
distribute-rgt-neg-in95.7%
+-commutative95.7%
distribute-neg-in95.7%
metadata-eval95.7%
sub-neg95.7%
Simplified95.7%
if -0.5 < (-.f64 x #s(literal 1 binary64)) Initial program 98.4%
fma-define98.4%
sub-neg98.4%
metadata-eval98.4%
sub-neg98.4%
metadata-eval98.4%
sub-neg98.4%
log1p-define99.7%
Simplified99.7%
Taylor expanded in y around 0 97.0%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* (+ z -1.0) (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5)))))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((((-1.0d0) + x) * log(y)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5)))))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * N[(N[(y * -0.3333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 86.8%
Taylor expanded in y around 0 99.1%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* y (+ (* -0.5 (* y (+ z -1.0))) (- 1.0 z)))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + (y * ((-0.5 * (y * (z + -1.0))) + (1.0 - z)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((((-1.0d0) + x) * log(y)) + (y * (((-0.5d0) * (y * (z + (-1.0d0)))) + (1.0d0 - z)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + (y * ((-0.5 * (y * (z + -1.0))) + (1.0 - z)))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + (y * ((-0.5 * (y * (z + -1.0))) + (1.0 - z)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(y * Float64(Float64(-0.5 * Float64(y * Float64(z + -1.0))) + Float64(1.0 - z)))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + (y * ((-0.5 * (y * (z + -1.0))) + (1.0 - z)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(-0.5 * N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + y \cdot \left(-0.5 \cdot \left(y \cdot \left(z + -1\right)\right) + \left(1 - z\right)\right)\right) - t
\end{array}
Initial program 86.8%
Taylor expanded in y around 0 98.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* (+ z -1.0) (* y (+ -1.0 (* y -0.5))))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((((-1.0d0) + x) * log(y)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * (-0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * -0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot -0.5\right)\right)\right) - t
\end{array}
Initial program 86.8%
Taylor expanded in y around 0 98.8%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.7e+39)
(- (* x (log y)) t)
(if (<= x 0.0152)
(- (- t) (+ (log y) (* z y)))
(- (* (+ -1.0 x) (log y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.7e+39) {
tmp = (x * log(y)) - t;
} else if (x <= 0.0152) {
tmp = -t - (log(y) + (z * y));
} else {
tmp = ((-1.0 + x) * log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.7d+39)) then
tmp = (x * log(y)) - t
else if (x <= 0.0152d0) then
tmp = -t - (log(y) + (z * y))
else
tmp = (((-1.0d0) + x) * log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.7e+39) {
tmp = (x * Math.log(y)) - t;
} else if (x <= 0.0152) {
tmp = -t - (Math.log(y) + (z * y));
} else {
tmp = ((-1.0 + x) * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.7e+39: tmp = (x * math.log(y)) - t elif x <= 0.0152: tmp = -t - (math.log(y) + (z * y)) else: tmp = ((-1.0 + x) * math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.7e+39) tmp = Float64(Float64(x * log(y)) - t); elseif (x <= 0.0152) tmp = Float64(Float64(-t) - Float64(log(y) + Float64(z * y))); else tmp = Float64(Float64(Float64(-1.0 + x) * log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.7e+39) tmp = (x * log(y)) - t; elseif (x <= 0.0152) tmp = -t - (log(y) + (z * y)); else tmp = ((-1.0 + x) * log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.7e+39], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 0.0152], N[((-t) - N[(N[Log[y], $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+39}:\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{elif}\;x \leq 0.0152:\\
\;\;\;\;\left(-t\right) - \left(\log y + z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-1 + x\right) \cdot \log y - t\\
\end{array}
\end{array}
if x < -1.6999999999999999e39Initial program 98.9%
Taylor expanded in y around 0 99.5%
Taylor expanded in y around 0 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x around inf 97.6%
*-commutative97.6%
Simplified97.6%
if -1.6999999999999999e39 < x < 0.0152Initial program 75.3%
Taylor expanded in y around 0 98.0%
+-commutative98.0%
sub-neg98.0%
metadata-eval98.0%
mul-1-neg98.0%
unsub-neg98.0%
+-commutative98.0%
sub-neg98.0%
metadata-eval98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in z around inf 97.9%
Taylor expanded in x around 0 95.7%
neg-mul-195.7%
Simplified95.7%
if 0.0152 < x Initial program 98.4%
fma-define98.4%
sub-neg98.4%
metadata-eval98.4%
sub-neg98.4%
metadata-eval98.4%
sub-neg98.4%
log1p-define99.7%
Simplified99.7%
Taylor expanded in y around 0 97.0%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (if (<= z -4.3e+217) (* z (- (- y) (/ t z))) (if (<= z 2.25e+181) (- (* (+ -1.0 x) (log y)) t) (- (* y (- 1.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.3e+217) {
tmp = z * (-y - (t / z));
} else if (z <= 2.25e+181) {
tmp = ((-1.0 + x) * log(y)) - t;
} else {
tmp = (y * (1.0 - 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 (z <= (-4.3d+217)) then
tmp = z * (-y - (t / z))
else if (z <= 2.25d+181) then
tmp = (((-1.0d0) + x) * log(y)) - t
else
tmp = (y * (1.0d0 - z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.3e+217) {
tmp = z * (-y - (t / z));
} else if (z <= 2.25e+181) {
tmp = ((-1.0 + x) * Math.log(y)) - t;
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.3e+217: tmp = z * (-y - (t / z)) elif z <= 2.25e+181: tmp = ((-1.0 + x) * math.log(y)) - t else: tmp = (y * (1.0 - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.3e+217) tmp = Float64(z * Float64(Float64(-y) - Float64(t / z))); elseif (z <= 2.25e+181) tmp = Float64(Float64(Float64(-1.0 + x) * log(y)) - t); else tmp = Float64(Float64(y * Float64(1.0 - z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.3e+217) tmp = z * (-y - (t / z)); elseif (z <= 2.25e+181) tmp = ((-1.0 + x) * log(y)) - t; else tmp = (y * (1.0 - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.3e+217], N[(z * N[((-y) - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+181], N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+217}:\\
\;\;\;\;z \cdot \left(\left(-y\right) - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+181}:\\
\;\;\;\;\left(-1 + x\right) \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if z < -4.3000000000000001e217Initial program 37.5%
Taylor expanded in y around 0 95.1%
+-commutative95.1%
sub-neg95.1%
metadata-eval95.1%
mul-1-neg95.1%
unsub-neg95.1%
+-commutative95.1%
sub-neg95.1%
metadata-eval95.1%
+-commutative95.1%
Simplified95.1%
Taylor expanded in z around inf 88.1%
associate-*r*88.1%
neg-mul-188.1%
Simplified88.1%
Taylor expanded in z around inf 88.2%
*-commutative88.2%
distribute-lft-out88.2%
neg-mul-188.2%
distribute-lft-neg-in88.2%
distribute-rgt-neg-in88.2%
Simplified88.2%
if -4.3000000000000001e217 < z < 2.25e181Initial program 94.3%
fma-define94.3%
sub-neg94.3%
metadata-eval94.3%
sub-neg94.3%
metadata-eval94.3%
sub-neg94.3%
log1p-define99.8%
Simplified99.8%
Taylor expanded in y around 0 92.7%
if 2.25e181 < z Initial program 56.7%
Taylor expanded in y around 0 97.9%
+-commutative97.9%
sub-neg97.9%
metadata-eval97.9%
mul-1-neg97.9%
unsub-neg97.9%
+-commutative97.9%
sub-neg97.9%
metadata-eval97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in y around inf 85.4%
associate--l+85.4%
mul-1-neg85.4%
log-rec85.4%
sub-neg85.4%
metadata-eval85.4%
associate-/l*85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in y around inf 80.8%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.4e+67) (not (<= x 2.7e+107))) (* x (log y)) (- (* y (- 1.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.4e+67) || !(x <= 2.7e+107)) {
tmp = x * log(y);
} else {
tmp = (y * (1.0 - 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 ((x <= (-1.4d+67)) .or. (.not. (x <= 2.7d+107))) then
tmp = x * log(y)
else
tmp = (y * (1.0d0 - z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.4e+67) || !(x <= 2.7e+107)) {
tmp = x * Math.log(y);
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.4e+67) or not (x <= 2.7e+107): tmp = x * math.log(y) else: tmp = (y * (1.0 - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.4e+67) || !(x <= 2.7e+107)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(y * Float64(1.0 - z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.4e+67) || ~((x <= 2.7e+107))) tmp = x * log(y); else tmp = (y * (1.0 - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.4e+67], N[Not[LessEqual[x, 2.7e+107]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+67} \lor \neg \left(x \leq 2.7 \cdot 10^{+107}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if x < -1.3999999999999999e67 or 2.7000000000000001e107 < x Initial program 99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
sub-neg99.4%
log1p-define99.5%
Simplified99.5%
Taylor expanded in t around inf 71.2%
associate--l+71.2%
sub-neg71.2%
metadata-eval71.2%
associate-/l*71.2%
+-commutative71.2%
associate-/l*69.7%
sub-neg69.7%
metadata-eval69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in x around inf 75.0%
*-commutative75.0%
Simplified75.0%
if -1.3999999999999999e67 < x < 2.7000000000000001e107Initial program 78.8%
Taylor expanded in y around 0 97.7%
+-commutative97.7%
sub-neg97.7%
metadata-eval97.7%
mul-1-neg97.7%
unsub-neg97.7%
+-commutative97.7%
sub-neg97.7%
metadata-eval97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in y around inf 95.1%
associate--l+95.1%
mul-1-neg95.1%
log-rec95.1%
sub-neg95.1%
metadata-eval95.1%
associate-/l*95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in y around inf 70.1%
Final simplification72.0%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + (y * (1.0 - z))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((((-1.0d0) + x) * log(y)) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 86.8%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
mul-1-neg98.4%
unsub-neg98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (- (- (* (+ -1.0 x) (log y)) (* z y)) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(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 = ((((-1.0d0) + x) * log(y)) - (z * y)) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) - (z * y)) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) - (z * y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) - Float64(z * y)) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) - (z * y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y - z \cdot y\right) - t
\end{array}
Initial program 86.8%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
mul-1-neg98.4%
unsub-neg98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in z around inf 98.3%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (- (* y (- 1.0 z)) t))
double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * (1.0d0 - z)) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) - t;
}
def code(x, y, z, t): return (y * (1.0 - z)) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(1.0 - z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * (1.0 - z)) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(1 - z\right) - t
\end{array}
Initial program 86.8%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
mul-1-neg98.4%
unsub-neg98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in y around inf 73.1%
associate--l+73.1%
mul-1-neg73.1%
log-rec73.1%
sub-neg73.1%
metadata-eval73.1%
associate-/l*73.0%
+-commutative73.0%
Simplified73.0%
Taylor expanded in y around inf 52.9%
Final simplification52.9%
(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 86.8%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
mul-1-neg98.4%
unsub-neg98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in z around inf 52.7%
associate-*r*52.7%
neg-mul-152.7%
Simplified52.7%
Final simplification52.7%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t
end function
public static double code(double x, double y, double z, double t) {
return -t;
}
def code(x, y, z, t): return -t
function code(x, y, z, t) return Float64(-t) end
function tmp = code(x, y, z, t) tmp = -t; end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 86.8%
fma-define86.8%
sub-neg86.8%
metadata-eval86.8%
sub-neg86.8%
metadata-eval86.8%
sub-neg86.8%
log1p-define99.8%
Simplified99.8%
Taylor expanded in t around inf 39.2%
mul-1-neg39.2%
Simplified39.2%
Final simplification39.2%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return y end
function tmp = code(x, y, z, t) tmp = y; end
code[x_, y_, z_, t_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 86.8%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
mul-1-neg98.4%
unsub-neg98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in z around 0 84.7%
sub-neg84.7%
metadata-eval84.7%
+-commutative84.7%
neg-mul-184.7%
unsub-neg84.7%
Simplified84.7%
Taylor expanded in y around inf 2.8%
Final simplification2.8%
herbie shell --seed 2024082
(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))