
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (fma (+ z -1.0) (log1p (- y)) (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 91.0%
sub-neg91.0%
+-commutative91.0%
associate-+l+91.0%
fma-define91.0%
sub-neg91.0%
metadata-eval91.0%
sub-neg91.0%
log1p-define99.8%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (- (fma (+ z -1.0) (log1p (- y)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), (log(y) * (-1.0 + x))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 91.0%
+-commutative91.0%
fma-define91.0%
sub-neg91.0%
metadata-eval91.0%
sub-neg91.0%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (log y) (+ -1.0 x))
(*
(+ 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 ((log(y) * (-1.0 + x)) + ((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 = ((log(y) * ((-1.0d0) + x)) + ((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 ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((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(log(y) * Float64(-1.0 + x)) + 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 = ((log(y) * (-1.0 + x)) + ((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[Log[y], $MachinePrecision] * N[(-1.0 + x), $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(\log y \cdot \left(-1 + x\right) + \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 91.0%
Taylor expanded in y around 0 99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.8e+136) (not (<= z 1.12e+55))) (- (* z (- (* (log y) (/ (+ -1.0 x) z)) y)) t) (+ (* (log y) (+ -1.0 x)) (- y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.8e+136) || !(z <= 1.12e+55)) {
tmp = (z * ((log(y) * ((-1.0 + x) / z)) - y)) - t;
} else {
tmp = (log(y) * (-1.0 + x)) + (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 ((z <= (-2.8d+136)) .or. (.not. (z <= 1.12d+55))) then
tmp = (z * ((log(y) * (((-1.0d0) + x) / z)) - y)) - t
else
tmp = (log(y) * ((-1.0d0) + x)) + (y - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.8e+136) || !(z <= 1.12e+55)) {
tmp = (z * ((Math.log(y) * ((-1.0 + x) / z)) - y)) - t;
} else {
tmp = (Math.log(y) * (-1.0 + x)) + (y - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.8e+136) or not (z <= 1.12e+55): tmp = (z * ((math.log(y) * ((-1.0 + x) / z)) - y)) - t else: tmp = (math.log(y) * (-1.0 + x)) + (y - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.8e+136) || !(z <= 1.12e+55)) tmp = Float64(Float64(z * Float64(Float64(log(y) * Float64(Float64(-1.0 + x) / z)) - y)) - t); else tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(y - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.8e+136) || ~((z <= 1.12e+55))) tmp = (z * ((log(y) * ((-1.0 + x) / z)) - y)) - t; else tmp = (log(y) * (-1.0 + x)) + (y - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.8e+136], N[Not[LessEqual[z, 1.12e+55]], $MachinePrecision]], N[(N[(z * N[(N[(N[Log[y], $MachinePrecision] * N[(N[(-1.0 + x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(y - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+136} \lor \neg \left(z \leq 1.12 \cdot 10^{+55}\right):\\
\;\;\;\;z \cdot \left(\log y \cdot \frac{-1 + x}{z} - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) + \left(y - t\right)\\
\end{array}
\end{array}
if z < -2.8000000000000002e136 or 1.12000000000000006e55 < z Initial program 72.9%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in z around inf 98.8%
sub-neg98.8%
metadata-eval98.8%
associate-/l*98.7%
+-commutative98.7%
mul-1-neg98.7%
unsub-neg98.7%
Simplified98.7%
Taylor expanded in z around inf 98.7%
if -2.8000000000000002e136 < z < 1.12000000000000006e55Initial program 99.8%
Taylor expanded in y around 0 99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
*-commutative99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in z around 0 99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
neg-mul-199.5%
unsub-neg99.5%
Simplified99.5%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -2e+31)
(- (* x (log y)) t)
(if (<= (+ -1.0 x) -1.0)
(- (- (* y (- 1.0 z)) (log y)) t)
(- (* (log y) (+ -1.0 x)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -2e+31) {
tmp = (x * log(y)) - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = ((y * (1.0 - z)) - log(y)) - t;
} else {
tmp = (log(y) * (-1.0 + x)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((-1.0d0) + x) <= (-2d+31)) then
tmp = (x * log(y)) - t
else if (((-1.0d0) + x) <= (-1.0d0)) then
tmp = ((y * (1.0d0 - z)) - log(y)) - t
else
tmp = (log(y) * ((-1.0d0) + x)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -2e+31) {
tmp = (x * Math.log(y)) - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
} else {
tmp = (Math.log(y) * (-1.0 + x)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -2e+31: tmp = (x * math.log(y)) - t elif (-1.0 + x) <= -1.0: tmp = ((y * (1.0 - z)) - math.log(y)) - t else: tmp = (math.log(y) * (-1.0 + x)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -2e+31) tmp = Float64(Float64(x * log(y)) - t); elseif (Float64(-1.0 + x) <= -1.0) tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); else tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -2e+31) tmp = (x * log(y)) - t; elseif ((-1.0 + x) <= -1.0) tmp = ((y * (1.0 - z)) - log(y)) - t; else tmp = (log(y) * (-1.0 + x)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -2e+31], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -2 \cdot 10^{+31}:\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{elif}\;-1 + x \leq -1:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -1.9999999999999999e31Initial program 99.8%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
*-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 76.3%
sub-neg76.3%
metadata-eval76.3%
associate-/l*76.1%
+-commutative76.1%
mul-1-neg76.1%
unsub-neg76.1%
Simplified76.1%
Taylor expanded in x around inf 99.8%
*-commutative99.8%
Simplified99.8%
if -1.9999999999999999e31 < (-.f64 x #s(literal 1 binary64)) < -1Initial program 83.2%
flip--83.2%
metadata-eval83.2%
metadata-eval83.2%
associate-*l/83.2%
metadata-eval83.2%
fma-neg83.2%
metadata-eval83.2%
+-commutative83.2%
Applied egg-rr83.2%
Taylor expanded in x around 0 82.4%
+-commutative82.4%
mul-1-neg82.4%
sub-neg82.4%
sub-neg82.4%
log1p-undefine99.1%
*-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in y around 0 98.1%
mul-1-neg98.1%
sub-neg98.1%
metadata-eval98.1%
distribute-rgt-neg-in98.1%
+-commutative98.1%
distribute-neg-in98.1%
metadata-eval98.1%
sub-neg98.1%
Simplified98.1%
if -1 < (-.f64 x #s(literal 1 binary64)) Initial program 99.6%
Taylor expanded in y around 0 99.6%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (+ z -1.0) (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5)))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((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 = ((log(y) * ((-1.0d0) + x)) + ((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 ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + 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 = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - 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[(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(\log y \cdot \left(-1 + x\right) + \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 91.0%
Taylor expanded in y around 0 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (+ z -1.0) (* y (+ -1.0 (* y -0.5))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((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 = ((log(y) * ((-1.0d0) + x)) + ((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 ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * -0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - 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[(y * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $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(-1 + y \cdot -0.5\right)\right)\right) - t
\end{array}
Initial program 91.0%
Taylor expanded in y around 0 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.4e+21) (not (<= x 1.0))) (- (* x (log y)) t) (- (- t) (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.4e+21) || !(x <= 1.0)) {
tmp = (x * log(y)) - t;
} 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) :: tmp
if ((x <= (-2.4d+21)) .or. (.not. (x <= 1.0d0))) then
tmp = (x * log(y)) - t
else
tmp = -t - log(y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.4e+21) || !(x <= 1.0)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = -t - Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.4e+21) or not (x <= 1.0): tmp = (x * math.log(y)) - t else: tmp = -t - math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.4e+21) || !(x <= 1.0)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(-t) - log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.4e+21) || ~((x <= 1.0))) tmp = (x * log(y)) - t; else tmp = -t - log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.4e+21], N[Not[LessEqual[x, 1.0]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+21} \lor \neg \left(x \leq 1\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - \log y\\
\end{array}
\end{array}
if x < -2.4e21 or 1 < x Initial program 98.9%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
mul-1-neg99.7%
unsub-neg99.7%
*-commutative99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 77.5%
sub-neg77.5%
metadata-eval77.5%
associate-/l*77.3%
+-commutative77.3%
mul-1-neg77.3%
unsub-neg77.3%
Simplified77.3%
Taylor expanded in x around inf 98.9%
*-commutative98.9%
Simplified98.9%
if -2.4e21 < x < 1Initial program 83.8%
flip--83.8%
metadata-eval83.8%
metadata-eval83.8%
associate-*l/83.8%
metadata-eval83.8%
fma-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Applied egg-rr83.8%
Taylor expanded in x around 0 83.5%
+-commutative83.5%
mul-1-neg83.5%
sub-neg83.5%
sub-neg83.5%
log1p-undefine99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 82.1%
neg-mul-182.1%
Simplified82.1%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.6e+87) (not (<= t 310.0))) (- (* z (- (/ y z) y)) t) (* (log y) (+ -1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.6e+87) || !(t <= 310.0)) {
tmp = (z * ((y / z) - y)) - 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 <= (-1.6d+87)) .or. (.not. (t <= 310.0d0))) then
tmp = (z * ((y / z) - y)) - 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 <= -1.6e+87) || !(t <= 310.0)) {
tmp = (z * ((y / z) - y)) - t;
} else {
tmp = Math.log(y) * (-1.0 + x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.6e+87) or not (t <= 310.0): tmp = (z * ((y / z) - y)) - t else: tmp = math.log(y) * (-1.0 + x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.6e+87) || !(t <= 310.0)) tmp = Float64(Float64(z * Float64(Float64(y / z) - y)) - 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 <= -1.6e+87) || ~((t <= 310.0))) tmp = (z * ((y / z) - y)) - t; else tmp = log(y) * (-1.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.6e+87], N[Not[LessEqual[t, 310.0]], $MachinePrecision]], N[(N[(z * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+87} \lor \neg \left(t \leq 310\right):\\
\;\;\;\;z \cdot \left(\frac{y}{z} - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\end{array}
\end{array}
if t < -1.6e87 or 310 < t Initial program 94.8%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
*-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 89.6%
sub-neg89.6%
metadata-eval89.6%
associate-/l*89.5%
+-commutative89.5%
mul-1-neg89.5%
unsub-neg89.5%
Simplified89.5%
Taylor expanded in y around inf 75.0%
associate-*r*75.0%
*-commutative75.0%
associate-*l*75.0%
sub-neg75.0%
metadata-eval75.0%
distribute-rgt-in75.0%
associate-*l/75.0%
*-lft-identity75.0%
neg-mul-175.0%
sub-neg75.0%
Simplified75.0%
if -1.6e87 < t < 310Initial program 88.1%
Taylor expanded in t around inf 68.9%
sub-neg68.9%
sub-neg68.9%
metadata-eval68.9%
associate-/l*68.7%
+-commutative68.7%
sub-neg68.7%
metadata-eval68.7%
associate-/l*64.4%
+-commutative64.4%
metadata-eval64.4%
Simplified64.4%
Taylor expanded in y around 0 68.4%
sub-neg68.4%
sub-neg68.4%
metadata-eval68.4%
associate-*r/68.2%
+-commutative68.2%
metadata-eval68.2%
Simplified68.2%
Taylor expanded in t around 0 82.1%
Final simplification79.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.35e+65) (not (<= x 6.6e+21))) (* x (log y)) (- (- t) (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.35e+65) || !(x <= 6.6e+21)) {
tmp = x * log(y);
} 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) :: tmp
if ((x <= (-1.35d+65)) .or. (.not. (x <= 6.6d+21))) then
tmp = x * log(y)
else
tmp = -t - log(y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.35e+65) || !(x <= 6.6e+21)) {
tmp = x * Math.log(y);
} else {
tmp = -t - Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.35e+65) or not (x <= 6.6e+21): tmp = x * math.log(y) else: tmp = -t - math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.35e+65) || !(x <= 6.6e+21)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-t) - log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.35e+65) || ~((x <= 6.6e+21))) tmp = x * log(y); else tmp = -t - log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.35e+65], N[Not[LessEqual[x, 6.6e+21]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+65} \lor \neg \left(x \leq 6.6 \cdot 10^{+21}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - \log y\\
\end{array}
\end{array}
if x < -1.35000000000000009e65 or 6.6e21 < x Initial program 99.7%
Taylor expanded in y around 0 99.7%
Taylor expanded in x around inf 77.6%
*-commutative77.6%
Simplified77.6%
if -1.35000000000000009e65 < x < 6.6e21Initial program 84.7%
flip--84.7%
metadata-eval84.7%
metadata-eval84.7%
associate-*l/84.7%
metadata-eval84.7%
fma-neg84.7%
metadata-eval84.7%
+-commutative84.7%
Applied egg-rr84.7%
Taylor expanded in x around 0 81.0%
+-commutative81.0%
mul-1-neg81.0%
sub-neg81.0%
sub-neg81.0%
log1p-undefine96.4%
*-commutative96.4%
sub-neg96.4%
metadata-eval96.4%
+-commutative96.4%
Simplified96.4%
Taylor expanded in y around 0 79.7%
neg-mul-179.7%
Simplified79.7%
Final simplification78.8%
(FPCore (x y z t) :precision binary64 (if (<= z 5.9e+237) (+ (* (log y) (+ -1.0 x)) (- y t)) (- (* z (- (/ y z) y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.9e+237) {
tmp = (log(y) * (-1.0 + x)) + (y - t);
} else {
tmp = (z * ((y / z) - 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 (z <= 5.9d+237) then
tmp = (log(y) * ((-1.0d0) + x)) + (y - t)
else
tmp = (z * ((y / z) - y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.9e+237) {
tmp = (Math.log(y) * (-1.0 + x)) + (y - t);
} else {
tmp = (z * ((y / z) - y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 5.9e+237: tmp = (math.log(y) * (-1.0 + x)) + (y - t) else: tmp = (z * ((y / z) - y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 5.9e+237) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(y - t)); else tmp = Float64(Float64(z * Float64(Float64(y / z) - y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 5.9e+237) tmp = (log(y) * (-1.0 + x)) + (y - t); else tmp = (z * ((y / z) - y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 5.9e+237], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(y - t), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.9 \cdot 10^{+237}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) + \left(y - t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{y}{z} - y\right) - t\\
\end{array}
\end{array}
if z < 5.8999999999999997e237Initial program 92.7%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
*-commutative99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in z around 0 91.9%
sub-neg91.9%
metadata-eval91.9%
+-commutative91.9%
neg-mul-191.9%
unsub-neg91.9%
Simplified91.9%
if 5.8999999999999997e237 < z Initial program 45.8%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
*-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-in100.0%
associate-*l/100.0%
*-lft-identity100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Final simplification92.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.35e+65) (not (<= x 1.22e+23))) (* x (log y)) (- (* z (- (/ y z) y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.35e+65) || !(x <= 1.22e+23)) {
tmp = x * log(y);
} else {
tmp = (z * ((y / z) - 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.35d+65)) .or. (.not. (x <= 1.22d+23))) then
tmp = x * log(y)
else
tmp = (z * ((y / z) - 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.35e+65) || !(x <= 1.22e+23)) {
tmp = x * Math.log(y);
} else {
tmp = (z * ((y / z) - y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.35e+65) or not (x <= 1.22e+23): tmp = x * math.log(y) else: tmp = (z * ((y / z) - y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.35e+65) || !(x <= 1.22e+23)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(z * Float64(Float64(y / z) - y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.35e+65) || ~((x <= 1.22e+23))) tmp = x * log(y); else tmp = (z * ((y / z) - y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.35e+65], N[Not[LessEqual[x, 1.22e+23]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+65} \lor \neg \left(x \leq 1.22 \cdot 10^{+23}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{y}{z} - y\right) - t\\
\end{array}
\end{array}
if x < -1.35000000000000009e65 or 1.22e23 < x Initial program 99.7%
Taylor expanded in y around 0 99.7%
Taylor expanded in x around inf 77.6%
*-commutative77.6%
Simplified77.6%
if -1.35000000000000009e65 < x < 1.22e23Initial program 84.7%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
*-commutative99.0%
mul-1-neg99.0%
unsub-neg99.0%
*-commutative99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in z around inf 97.6%
sub-neg97.6%
metadata-eval97.6%
associate-/l*97.5%
+-commutative97.5%
mul-1-neg97.5%
unsub-neg97.5%
Simplified97.5%
Taylor expanded in y around inf 57.9%
associate-*r*57.8%
*-commutative57.8%
associate-*l*57.9%
sub-neg57.9%
metadata-eval57.9%
distribute-rgt-in57.9%
associate-*l/57.9%
*-lft-identity57.9%
neg-mul-157.9%
sub-neg57.9%
Simplified57.9%
Final simplification66.2%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + (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 = ((log(y) * ((-1.0d0) + x)) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 91.0%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
*-commutative99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (if (<= z 1.6e+233) (- (* (log y) (+ -1.0 x)) t) (- (* z (- (/ y z) y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.6e+233) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = (z * ((y / z) - 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 (z <= 1.6d+233) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = (z * ((y / z) - y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.6e+233) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = (z * ((y / z) - y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 1.6e+233: tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = (z * ((y / z) - y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 1.6e+233) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(z * Float64(Float64(y / z) - y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 1.6e+233) tmp = (log(y) * (-1.0 + x)) - t; else tmp = (z * ((y / z) - y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 1.6e+233], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.6 \cdot 10^{+233}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{y}{z} - y\right) - t\\
\end{array}
\end{array}
if z < 1.60000000000000009e233Initial program 92.7%
Taylor expanded in y around 0 91.9%
if 1.60000000000000009e233 < z Initial program 45.8%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
*-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-in100.0%
associate-*l/100.0%
*-lft-identity100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Final simplification92.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.6e-14) (not (<= t 8.5e+29))) (- t) (* y (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.6e-14) || !(t <= 8.5e+29)) {
tmp = -t;
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4.6d-14)) .or. (.not. (t <= 8.5d+29))) then
tmp = -t
else
tmp = y * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.6e-14) || !(t <= 8.5e+29)) {
tmp = -t;
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.6e-14) or not (t <= 8.5e+29): tmp = -t else: tmp = y * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.6e-14) || !(t <= 8.5e+29)) tmp = Float64(-t); else tmp = Float64(y * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.6e-14) || ~((t <= 8.5e+29))) tmp = -t; else tmp = y * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.6e-14], N[Not[LessEqual[t, 8.5e+29]], $MachinePrecision]], (-t), N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{-14} \lor \neg \left(t \leq 8.5 \cdot 10^{+29}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if t < -4.59999999999999996e-14 or 8.5000000000000006e29 < t Initial program 96.1%
Taylor expanded in t around inf 64.3%
mul-1-neg64.3%
Simplified64.3%
if -4.59999999999999996e-14 < t < 8.5000000000000006e29Initial program 85.9%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in y around inf 17.1%
Final simplification40.7%
(FPCore (x y z t) :precision binary64 (if (<= t -5.2e-14) (+ -1.0 (- 1.0 t)) (if (<= t 8.5e+29) (* y (- 1.0 z)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.2e-14) {
tmp = -1.0 + (1.0 - t);
} else if (t <= 8.5e+29) {
tmp = y * (1.0 - z);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5.2d-14)) then
tmp = (-1.0d0) + (1.0d0 - t)
else if (t <= 8.5d+29) then
tmp = y * (1.0d0 - z)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.2e-14) {
tmp = -1.0 + (1.0 - t);
} else if (t <= 8.5e+29) {
tmp = y * (1.0 - z);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.2e-14: tmp = -1.0 + (1.0 - t) elif t <= 8.5e+29: tmp = y * (1.0 - z) else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.2e-14) tmp = Float64(-1.0 + Float64(1.0 - t)); elseif (t <= 8.5e+29) tmp = Float64(y * Float64(1.0 - z)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.2e-14) tmp = -1.0 + (1.0 - t); elseif (t <= 8.5e+29) tmp = y * (1.0 - z); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.2e-14], N[(-1.0 + N[(1.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+29], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-14}:\\
\;\;\;\;-1 + \left(1 - t\right)\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -5.19999999999999993e-14Initial program 93.8%
Taylor expanded in t around inf 56.6%
mul-1-neg56.6%
Simplified56.6%
expm1-log1p-u51.5%
expm1-undefine51.5%
Applied egg-rr51.5%
sub-neg51.5%
log1p-undefine51.5%
rem-exp-log56.6%
unsub-neg56.6%
metadata-eval56.6%
Simplified56.6%
if -5.19999999999999993e-14 < t < 8.5000000000000006e29Initial program 85.9%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in y around inf 17.1%
if 8.5000000000000006e29 < t Initial program 98.4%
Taylor expanded in t around inf 72.0%
mul-1-neg72.0%
Simplified72.0%
Final simplification40.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.1e-14) (not (<= t 8.5e+29))) (- t) (* z (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.1e-14) || !(t <= 8.5e+29)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.1d-14)) .or. (.not. (t <= 8.5d+29))) then
tmp = -t
else
tmp = z * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.1e-14) || !(t <= 8.5e+29)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.1e-14) or not (t <= 8.5e+29): tmp = -t else: tmp = z * -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.1e-14) || !(t <= 8.5e+29)) tmp = Float64(-t); else tmp = Float64(z * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.1e-14) || ~((t <= 8.5e+29))) tmp = -t; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.1e-14], N[Not[LessEqual[t, 8.5e+29]], $MachinePrecision]], (-t), N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-14} \lor \neg \left(t \leq 8.5 \cdot 10^{+29}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < -1.1e-14 or 8.5000000000000006e29 < t Initial program 96.1%
Taylor expanded in t around inf 64.3%
mul-1-neg64.3%
Simplified64.3%
if -1.1e-14 < t < 8.5000000000000006e29Initial program 85.9%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in z around inf 16.4%
associate-*r*16.4%
neg-mul-116.4%
Simplified16.4%
Final simplification40.4%
(FPCore (x y z t) :precision binary64 (- (* z (- (/ y z) y)) t))
double code(double x, double y, double z, double t) {
return (z * ((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 = (z * ((y / z) - y)) - t
end function
public static double code(double x, double y, double z, double t) {
return (z * ((y / z) - y)) - t;
}
def code(x, y, z, t): return (z * ((y / z) - y)) - t
function code(x, y, z, t) return Float64(Float64(z * Float64(Float64(y / z) - y)) - t) end
function tmp = code(x, y, z, t) tmp = (z * ((y / z) - y)) - t; end
code[x_, y_, z_, t_] := N[(N[(z * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(\frac{y}{z} - y\right) - t
\end{array}
Initial program 91.0%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
*-commutative99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in z around inf 88.3%
sub-neg88.3%
metadata-eval88.3%
associate-/l*88.2%
+-commutative88.2%
mul-1-neg88.2%
unsub-neg88.2%
Simplified88.2%
Taylor expanded in y around inf 43.1%
associate-*r*43.0%
*-commutative43.0%
associate-*l*43.1%
sub-neg43.1%
metadata-eval43.1%
distribute-rgt-in43.1%
associate-*l/43.1%
*-lft-identity43.1%
neg-mul-143.1%
sub-neg43.1%
Simplified43.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 91.0%
Taylor expanded in t around inf 34.0%
mul-1-neg34.0%
Simplified34.0%
(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 91.0%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
*-commutative99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in y around inf 11.7%
Taylor expanded in z around 0 2.9%
herbie shell --seed 2024137
(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))