
(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 (- (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 90.2%
+-commutative90.2%
fma-def90.2%
sub-neg90.2%
metadata-eval90.2%
sub-neg90.2%
log1p-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -2000.0) (not (<= (+ -1.0 x) -0.5))) (- (- (* x (log y)) (* z y)) t) (- (- (- (log y)) (* y (+ z -1.0))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -2000.0) || !((-1.0 + x) <= -0.5)) {
tmp = ((x * log(y)) - (z * y)) - t;
} else {
tmp = (-log(y) - (y * (z + -1.0))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((((-1.0d0) + x) <= (-2000.0d0)) .or. (.not. (((-1.0d0) + x) <= (-0.5d0)))) then
tmp = ((x * log(y)) - (z * y)) - t
else
tmp = (-log(y) - (y * (z + (-1.0d0)))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -2000.0) || !((-1.0 + x) <= -0.5)) {
tmp = ((x * Math.log(y)) - (z * y)) - t;
} else {
tmp = (-Math.log(y) - (y * (z + -1.0))) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -2000.0) or not ((-1.0 + x) <= -0.5): tmp = ((x * math.log(y)) - (z * y)) - t else: tmp = (-math.log(y) - (y * (z + -1.0))) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -2000.0) || !(Float64(-1.0 + x) <= -0.5)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(z * y)) - t); else tmp = Float64(Float64(Float64(-log(y)) - Float64(y * Float64(z + -1.0))) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -2000.0) || ~(((-1.0 + x) <= -0.5))) tmp = ((x * log(y)) - (z * y)) - t; else tmp = (-log(y) - (y * (z + -1.0))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -2000.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.5]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[((-N[Log[y], $MachinePrecision]) - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -2000 \lor \neg \left(-1 + x \leq -0.5\right):\\
\;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\log y\right) - y \cdot \left(z + -1\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -2e3 or -0.5 < (-.f64 x 1) Initial program 91.6%
Taylor expanded in y around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
+-commutative98.9%
*-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in z around inf 98.9%
Taylor expanded in x around inf 97.9%
if -2e3 < (-.f64 x 1) < -0.5Initial program 88.7%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
+-commutative99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 98.0%
mul-1-neg98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -2000.0) (not (<= (+ -1.0 x) -0.5))) (- (- (* x (log y)) (* z y)) t) (- (- (- (log y)) (* z y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -2000.0) || !((-1.0 + x) <= -0.5)) {
tmp = ((x * log(y)) - (z * y)) - t;
} else {
tmp = (-log(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 ((((-1.0d0) + x) <= (-2000.0d0)) .or. (.not. (((-1.0d0) + x) <= (-0.5d0)))) then
tmp = ((x * log(y)) - (z * y)) - t
else
tmp = (-log(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 (((-1.0 + x) <= -2000.0) || !((-1.0 + x) <= -0.5)) {
tmp = ((x * Math.log(y)) - (z * y)) - t;
} else {
tmp = (-Math.log(y) - (z * y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -2000.0) or not ((-1.0 + x) <= -0.5): tmp = ((x * math.log(y)) - (z * y)) - t else: tmp = (-math.log(y) - (z * y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -2000.0) || !(Float64(-1.0 + x) <= -0.5)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(z * y)) - t); else tmp = Float64(Float64(Float64(-log(y)) - Float64(z * y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -2000.0) || ~(((-1.0 + x) <= -0.5))) tmp = ((x * log(y)) - (z * y)) - t; else tmp = (-log(y) - (z * y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -2000.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.5]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[((-N[Log[y], $MachinePrecision]) - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -2000 \lor \neg \left(-1 + x \leq -0.5\right):\\
\;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\log y\right) - z \cdot y\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -2e3 or -0.5 < (-.f64 x 1) Initial program 91.6%
Taylor expanded in y around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
+-commutative98.9%
*-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in z around inf 98.9%
Taylor expanded in x around inf 97.9%
if -2e3 < (-.f64 x 1) < -0.5Initial program 88.7%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
+-commutative99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in x around 0 98.0%
mul-1-neg98.0%
*-commutative98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -2e+29)
(- (* x (log y)) t)
(if (<= (+ -1.0 x) -1.0)
(- (- (- (log y)) (* z 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+29) {
tmp = (x * log(y)) - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = (-log(y) - (z * 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+29)) then
tmp = (x * log(y)) - t
else if (((-1.0d0) + x) <= (-1.0d0)) then
tmp = (-log(y) - (z * 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+29) {
tmp = (x * Math.log(y)) - t;
} else if ((-1.0 + x) <= -1.0) {
tmp = (-Math.log(y) - (z * 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+29: tmp = (x * math.log(y)) - t elif (-1.0 + x) <= -1.0: tmp = (-math.log(y) - (z * 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+29) tmp = Float64(Float64(x * log(y)) - t); elseif (Float64(-1.0 + x) <= -1.0) tmp = Float64(Float64(Float64(-log(y)) - Float64(z * 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+29) tmp = (x * log(y)) - t; elseif ((-1.0 + x) <= -1.0) tmp = (-log(y) - (z * 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+29], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0], N[(N[((-N[Log[y], $MachinePrecision]) - N[(z * 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^{+29}:\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{elif}\;-1 + x \leq -1:\\
\;\;\;\;\left(\left(-\log y\right) - z \cdot y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -1.99999999999999983e29Initial program 92.0%
Taylor expanded in y around 0 92.0%
Taylor expanded in x around inf 92.0%
if -1.99999999999999983e29 < (-.f64 x 1) < -1Initial program 86.3%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
+-commutative99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in x around 0 98.1%
mul-1-neg98.1%
*-commutative98.1%
Simplified98.1%
if -1 < (-.f64 x 1) Initial program 95.8%
Taylor expanded in y around 0 93.8%
Final simplification95.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (log y) (+ -1.0 x)))) (if (or (<= t -29000000.0) (not (<= t 1.8e-5))) (- t_1 t) (- t_1 (* z y)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * (-1.0 + x);
double tmp;
if ((t <= -29000000.0) || !(t <= 1.8e-5)) {
tmp = t_1 - t;
} else {
tmp = t_1 - (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = log(y) * ((-1.0d0) + x)
if ((t <= (-29000000.0d0)) .or. (.not. (t <= 1.8d-5))) then
tmp = t_1 - t
else
tmp = t_1 - (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(y) * (-1.0 + x);
double tmp;
if ((t <= -29000000.0) || !(t <= 1.8e-5)) {
tmp = t_1 - t;
} else {
tmp = t_1 - (z * y);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * (-1.0 + x) tmp = 0 if (t <= -29000000.0) or not (t <= 1.8e-5): tmp = t_1 - t else: tmp = t_1 - (z * y) return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * Float64(-1.0 + x)) tmp = 0.0 if ((t <= -29000000.0) || !(t <= 1.8e-5)) tmp = Float64(t_1 - t); else tmp = Float64(t_1 - Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * (-1.0 + x); tmp = 0.0; if ((t <= -29000000.0) || ~((t <= 1.8e-5))) tmp = t_1 - t; else tmp = t_1 - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -29000000.0], N[Not[LessEqual[t, 1.8e-5]], $MachinePrecision]], N[(t$95$1 - t), $MachinePrecision], N[(t$95$1 - N[(z * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(-1 + x\right)\\
\mathbf{if}\;t \leq -29000000 \lor \neg \left(t \leq 1.8 \cdot 10^{-5}\right):\\
\;\;\;\;t_1 - t\\
\mathbf{else}:\\
\;\;\;\;t_1 - z \cdot y\\
\end{array}
\end{array}
if t < -2.9e7 or 1.80000000000000005e-5 < t Initial program 95.2%
Taylor expanded in y around 0 94.6%
if -2.9e7 < t < 1.80000000000000005e-5Initial program 85.5%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
+-commutative99.3%
*-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in z around inf 99.3%
Taylor expanded in t around 0 98.4%
Final simplification96.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) (+ -1.0 x))))
(if (<= t -29000000.0)
(- t_1 t)
(if (<= t 1.7e-5) (- t_1 (* z y)) (- (+ y t_1) t)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * (-1.0 + x);
double tmp;
if (t <= -29000000.0) {
tmp = t_1 - t;
} else if (t <= 1.7e-5) {
tmp = t_1 - (z * y);
} else {
tmp = (y + t_1) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = log(y) * ((-1.0d0) + x)
if (t <= (-29000000.0d0)) then
tmp = t_1 - t
else if (t <= 1.7d-5) then
tmp = t_1 - (z * y)
else
tmp = (y + t_1) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(y) * (-1.0 + x);
double tmp;
if (t <= -29000000.0) {
tmp = t_1 - t;
} else if (t <= 1.7e-5) {
tmp = t_1 - (z * y);
} else {
tmp = (y + t_1) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * (-1.0 + x) tmp = 0 if t <= -29000000.0: tmp = t_1 - t elif t <= 1.7e-5: tmp = t_1 - (z * y) else: tmp = (y + t_1) - t return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * Float64(-1.0 + x)) tmp = 0.0 if (t <= -29000000.0) tmp = Float64(t_1 - t); elseif (t <= 1.7e-5) tmp = Float64(t_1 - Float64(z * y)); else tmp = Float64(Float64(y + t_1) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * (-1.0 + x); tmp = 0.0; if (t <= -29000000.0) tmp = t_1 - t; elseif (t <= 1.7e-5) tmp = t_1 - (z * y); else tmp = (y + t_1) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -29000000.0], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[t, 1.7e-5], N[(t$95$1 - N[(z * y), $MachinePrecision]), $MachinePrecision], N[(N[(y + t$95$1), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(-1 + x\right)\\
\mathbf{if}\;t \leq -29000000:\\
\;\;\;\;t_1 - t\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;t_1 - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(y + t_1\right) - t\\
\end{array}
\end{array}
if t < -2.9e7Initial program 97.0%
Taylor expanded in y around 0 95.9%
if -2.9e7 < t < 1.7e-5Initial program 85.5%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
+-commutative99.3%
*-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in z around inf 99.3%
Taylor expanded in t around 0 98.4%
if 1.7e-5 < t Initial program 93.6%
associate--l+93.6%
fma-def93.6%
sub-neg93.6%
metadata-eval93.6%
fma-neg93.6%
sub-neg93.6%
metadata-eval93.6%
sub-neg93.6%
log1p-def99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
+-commutative99.9%
unsub-neg99.9%
mul-1-neg99.9%
*-commutative99.9%
distribute-lft-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 93.6%
Final simplification96.6%
(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.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
+-commutative99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (- (- (* (log y) (+ -1.0 x)) (* z y)) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) - (z * y)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) - (z * y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) - (z * y)) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) - (z * y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) - Float64(z * y)) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) - (z * y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) - z \cdot y\right) - t
\end{array}
Initial program 90.2%
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%
+-commutative99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.6e+46) (not (<= t 9.8e+54))) (- (* z (- y)) t) (* (log y) (+ -1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.6e+46) || !(t <= 9.8e+54)) {
tmp = (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 <= (-3.6d+46)) .or. (.not. (t <= 9.8d+54))) then
tmp = (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 <= -3.6e+46) || !(t <= 9.8e+54)) {
tmp = (z * -y) - t;
} else {
tmp = Math.log(y) * (-1.0 + x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.6e+46) or not (t <= 9.8e+54): tmp = (z * -y) - t else: tmp = math.log(y) * (-1.0 + x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.6e+46) || !(t <= 9.8e+54)) tmp = Float64(Float64(z * Float64(-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 <= -3.6e+46) || ~((t <= 9.8e+54))) tmp = (z * -y) - t; else tmp = log(y) * (-1.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.6e+46], N[Not[LessEqual[t, 9.8e+54]], $MachinePrecision]], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+46} \lor \neg \left(t \leq 9.8 \cdot 10^{+54}\right):\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\end{array}
\end{array}
if t < -3.5999999999999999e46 or 9.80000000000000002e54 < t Initial program 96.3%
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%
+-commutative99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 81.7%
associate-*r*81.7%
neg-mul-181.7%
Simplified81.7%
if -3.5999999999999999e46 < t < 9.80000000000000002e54Initial program 86.4%
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%
+-commutative99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 99.4%
Taylor expanded in t around 0 92.4%
Taylor expanded in y around 0 79.1%
Final simplification80.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -155000.0) (not (<= t 330.0))) (- (* x (log y)) t) (* (log y) (+ -1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -155000.0) || !(t <= 330.0)) {
tmp = (x * log(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 <= (-155000.0d0)) .or. (.not. (t <= 330.0d0))) then
tmp = (x * log(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 <= -155000.0) || !(t <= 330.0)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = Math.log(y) * (-1.0 + x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -155000.0) or not (t <= 330.0): tmp = (x * math.log(y)) - t else: tmp = math.log(y) * (-1.0 + x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -155000.0) || !(t <= 330.0)) tmp = Float64(Float64(x * log(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 <= -155000.0) || ~((t <= 330.0))) tmp = (x * log(y)) - t; else tmp = log(y) * (-1.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -155000.0], N[Not[LessEqual[t, 330.0]], $MachinePrecision]], N[(N[(x * N[Log[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 -155000 \lor \neg \left(t \leq 330\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\end{array}
\end{array}
if t < -155000 or 330 < t Initial program 95.3%
Taylor expanded in y around 0 94.6%
Taylor expanded in x around inf 93.1%
if -155000 < t < 330Initial program 85.5%
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%
+-commutative99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 99.4%
Taylor expanded in t around 0 98.2%
Taylor expanded in y around 0 83.8%
Final simplification88.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.85e+213) (- (* x (log y)) (* z y)) (- (* (log y) (+ -1.0 x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85e+213) {
tmp = (x * log(y)) - (z * y);
} else {
tmp = (log(y) * (-1.0 + x)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.85d+213)) then
tmp = (x * log(y)) - (z * y)
else
tmp = (log(y) * ((-1.0d0) + x)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85e+213) {
tmp = (x * Math.log(y)) - (z * y);
} else {
tmp = (Math.log(y) * (-1.0 + x)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.85e+213: tmp = (x * math.log(y)) - (z * y) else: tmp = (math.log(y) * (-1.0 + x)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.85e+213) tmp = Float64(Float64(x * log(y)) - Float64(z * y)); else tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.85e+213) tmp = (x * log(y)) - (z * y); else tmp = (log(y) * (-1.0 + x)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.85e+213], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+213}:\\
\;\;\;\;x \cdot \log y - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\end{array}
\end{array}
if z < -1.84999999999999996e213Initial program 51.2%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
+-commutative99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
Taylor expanded in t around 0 84.3%
Taylor expanded in x around inf 80.0%
if -1.84999999999999996e213 < z Initial program 94.8%
Taylor expanded in y around 0 94.1%
Final simplification92.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2300.0) (not (<= x 400000000000.0))) (* x (log y)) (- (- (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2300.0) || !(x <= 400000000000.0)) {
tmp = x * log(y);
} else {
tmp = -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 <= (-2300.0d0)) .or. (.not. (x <= 400000000000.0d0))) then
tmp = x * log(y)
else
tmp = -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 <= -2300.0) || !(x <= 400000000000.0)) {
tmp = x * Math.log(y);
} else {
tmp = -Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2300.0) or not (x <= 400000000000.0): tmp = x * math.log(y) else: tmp = -math.log(y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2300.0) || !(x <= 400000000000.0)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2300.0) || ~((x <= 400000000000.0))) tmp = x * log(y); else tmp = -log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2300.0], N[Not[LessEqual[x, 400000000000.0]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2300 \lor \neg \left(x \leq 400000000000\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\
\end{array}
\end{array}
if x < -2300 or 4e11 < x Initial program 91.4%
associate--l+91.4%
fma-def91.4%
sub-neg91.4%
metadata-eval91.4%
fma-neg91.4%
sub-neg91.4%
metadata-eval91.4%
sub-neg91.4%
log1p-def99.8%
Simplified99.8%
Taylor expanded in y around 0 98.9%
mul-1-neg98.9%
+-commutative98.9%
unsub-neg98.9%
mul-1-neg98.9%
*-commutative98.9%
distribute-lft-neg-in98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in x around inf 70.7%
if -2300 < x < 4e11Initial program 89.1%
Taylor expanded in y around 0 88.9%
Taylor expanded in x around 0 86.7%
mul-1-neg86.7%
Simplified86.7%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.3e+26) (not (<= x 5.2e+61))) (* x (log y)) (- (* y (- 1.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.3e+26) || !(x <= 5.2e+61)) {
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 <= (-4.3d+26)) .or. (.not. (x <= 5.2d+61))) 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 <= -4.3e+26) || !(x <= 5.2e+61)) {
tmp = x * Math.log(y);
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.3e+26) or not (x <= 5.2e+61): 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 <= -4.3e+26) || !(x <= 5.2e+61)) 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 <= -4.3e+26) || ~((x <= 5.2e+61))) 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, -4.3e+26], N[Not[LessEqual[x, 5.2e+61]], $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 -4.3 \cdot 10^{+26} \lor \neg \left(x \leq 5.2 \cdot 10^{+61}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if x < -4.2999999999999998e26 or 5.19999999999999945e61 < x Initial program 94.0%
associate--l+94.0%
fma-def94.0%
sub-neg94.0%
metadata-eval94.0%
fma-neg94.0%
sub-neg94.0%
metadata-eval94.0%
sub-neg94.0%
log1p-def99.7%
Simplified99.7%
Taylor expanded in y around 0 99.2%
mul-1-neg99.2%
+-commutative99.2%
unsub-neg99.2%
mul-1-neg99.2%
*-commutative99.2%
distribute-lft-neg-in99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in x around inf 75.0%
if -4.2999999999999998e26 < x < 5.19999999999999945e61Initial program 87.3%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
+-commutative99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 59.3%
Final simplification66.1%
(FPCore (x y z t) :precision binary64 (if (<= t -14200000000.0) (- t) (if (<= t 16000.0) (* y (- 1.0 z)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -14200000000.0) {
tmp = -t;
} else if (t <= 16000.0) {
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 <= (-14200000000.0d0)) then
tmp = -t
else if (t <= 16000.0d0) 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 <= -14200000000.0) {
tmp = -t;
} else if (t <= 16000.0) {
tmp = y * (1.0 - z);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -14200000000.0: tmp = -t elif t <= 16000.0: tmp = y * (1.0 - z) else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -14200000000.0) tmp = Float64(-t); elseif (t <= 16000.0) 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 <= -14200000000.0) tmp = -t; elseif (t <= 16000.0) tmp = y * (1.0 - z); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -14200000000.0], (-t), If[LessEqual[t, 16000.0], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -14200000000:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 16000:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -1.42e10 or 16000 < t Initial program 95.8%
+-commutative95.8%
fma-def95.8%
sub-neg95.8%
metadata-eval95.8%
sub-neg95.8%
log1p-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 69.9%
mul-1-neg69.9%
Simplified69.9%
if -1.42e10 < t < 16000Initial program 85.1%
associate--l+85.1%
fma-def85.1%
sub-neg85.1%
metadata-eval85.1%
fma-neg85.1%
sub-neg85.1%
metadata-eval85.1%
sub-neg85.1%
log1p-def99.9%
Simplified99.9%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
+-commutative99.4%
unsub-neg99.4%
mul-1-neg99.4%
*-commutative99.4%
distribute-lft-neg-in99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around 0 99.4%
+-commutative99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 17.8%
Final simplification42.4%
(FPCore (x y z t) :precision binary64 (if (<= t -68000000.0) (- t) (if (<= t 4100.0) (* z (- y)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -68000000.0) {
tmp = -t;
} else if (t <= 4100.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 <= (-68000000.0d0)) then
tmp = -t
else if (t <= 4100.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 <= -68000000.0) {
tmp = -t;
} else if (t <= 4100.0) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -68000000.0: tmp = -t elif t <= 4100.0: tmp = z * -y else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -68000000.0) tmp = Float64(-t); elseif (t <= 4100.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 <= -68000000.0) tmp = -t; elseif (t <= 4100.0) tmp = z * -y; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -68000000.0], (-t), If[LessEqual[t, 4100.0], N[(z * (-y)), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -68000000:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 4100:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -6.8e7 or 4100 < t Initial program 95.8%
+-commutative95.8%
fma-def95.8%
sub-neg95.8%
metadata-eval95.8%
sub-neg95.8%
log1p-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 69.9%
mul-1-neg69.9%
Simplified69.9%
if -6.8e7 < t < 4100Initial program 85.1%
associate--l+85.1%
fma-def85.1%
sub-neg85.1%
metadata-eval85.1%
fma-neg85.1%
sub-neg85.1%
metadata-eval85.1%
sub-neg85.1%
log1p-def99.9%
Simplified99.9%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
+-commutative99.4%
unsub-neg99.4%
mul-1-neg99.4%
*-commutative99.4%
distribute-lft-neg-in99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 17.2%
mul-1-neg17.2%
*-commutative17.2%
distribute-rgt-neg-in17.2%
Simplified17.2%
Final simplification42.1%
(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 90.2%
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%
+-commutative99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 44.1%
Final simplification44.1%
(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.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
+-commutative99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 43.9%
associate-*r*43.9%
neg-mul-143.9%
Simplified43.9%
Final simplification43.9%
(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%
+-commutative90.2%
fma-def90.2%
sub-neg90.2%
metadata-eval90.2%
sub-neg90.2%
log1p-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 34.7%
mul-1-neg34.7%
Simplified34.7%
Final simplification34.7%
herbie shell --seed 2023274
(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))