
(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 16 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) (+ x -1.0)) t)))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), ((log(y) * (x + -1.0)) - t));
}
function code(x, y, z, t) return fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(Float64(log(y) * Float64(x + -1.0)) - t)) end
code[x_, y_, z_, t_] := N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(x + -1\right) - t\right)
\end{array}
Initial program 87.5%
+-commutative87.5%
associate--l+87.5%
fma-def87.5%
sub-neg87.5%
log1p-def99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ x -1.0)) (* z (log1p (- y)))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (x + -1.0)) + (z * log1p(-y))) - t;
}
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (x + -1.0)) + (z * Math.log1p(-y))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (x + -1.0)) + (z * math.log1p(-y))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(z * log1p(Float64(-y)))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(x + -1\right) + z \cdot \mathsf{log1p}\left(-y\right)\right) - t
\end{array}
Initial program 87.5%
Taylor expanded in z around inf 86.9%
*-commutative86.9%
sub-neg86.9%
mul-1-neg86.9%
log1p-def99.2%
mul-1-neg99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ x -1.0)) (* (- (* y (* y -0.5)) y) (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (x + -1.0)) + (((y * (y * -0.5)) - y) * (z + -1.0))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * (x + (-1.0d0))) + (((y * (y * (-0.5d0))) - y) * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (x + -1.0)) + (((y * (y * -0.5)) - y) * (z + -1.0))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (x + -1.0)) + (((y * (y * -0.5)) - y) * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(Float64(Float64(y * Float64(y * -0.5)) - y) * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (x + -1.0)) + (((y * (y * -0.5)) - y) * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * N[(y * -0.5), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(x + -1\right) + \left(y \cdot \left(y \cdot -0.5\right) - y\right) \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 87.5%
Taylor expanded in y around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
unpow298.9%
associate-*l*98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (- (- (* (log y) (+ x -1.0)) (* y (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (x + -1.0)) - (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) * (x + (-1.0d0))) - (y * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (x + -1.0)) - (y * (z + -1.0))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (x + -1.0)) - (y * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(x + -1.0)) - Float64(y * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (x + -1.0)) - (y * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(x + -1\right) - y \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 87.5%
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%
+-commutative98.3%
*-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
+-commutative98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t)))
(if (<= x -2.8e+27)
t_1
(if (<= x 3e-191)
(- (- (log y)) t)
(if (<= x 5e+27) (- (* (+ z -1.0) (- (* -0.5 (* y y)) y)) t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - t;
double tmp;
if (x <= -2.8e+27) {
tmp = t_1;
} else if (x <= 3e-191) {
tmp = -log(y) - t;
} else if (x <= 5e+27) {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - t
if (x <= (-2.8d+27)) then
tmp = t_1
else if (x <= 3d-191) then
tmp = -log(y) - t
else if (x <= 5d+27) then
tmp = ((z + (-1.0d0)) * (((-0.5d0) * (y * y)) - y)) - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * Math.log(y)) - t;
double tmp;
if (x <= -2.8e+27) {
tmp = t_1;
} else if (x <= 3e-191) {
tmp = -Math.log(y) - t;
} else if (x <= 5e+27) {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - t tmp = 0 if x <= -2.8e+27: tmp = t_1 elif x <= 3e-191: tmp = -math.log(y) - t elif x <= 5e+27: tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -2.8e+27) tmp = t_1; elseif (x <= 3e-191) tmp = Float64(Float64(-log(y)) - t); elseif (x <= 5e+27) tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - t; tmp = 0.0; if (x <= -2.8e+27) tmp = t_1; elseif (x <= 3e-191) tmp = -log(y) - t; elseif (x <= 5e+27) tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -2.8e+27], t$95$1, If[LessEqual[x, 3e-191], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], If[LessEqual[x, 5e+27], N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-191}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+27}:\\
\;\;\;\;\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.7999999999999999e27 or 4.99999999999999979e27 < x Initial program 94.1%
Taylor expanded in y around 0 99.7%
Taylor expanded in x around inf 93.5%
if -2.7999999999999999e27 < x < 3.0000000000000001e-191Initial program 85.3%
Taylor expanded in z around 0 82.8%
sub-neg82.8%
metadata-eval82.8%
mul-1-neg82.8%
unsub-neg82.8%
*-commutative82.8%
+-commutative82.8%
sub-neg82.8%
mul-1-neg82.8%
log1p-def82.8%
mul-1-neg82.8%
Simplified82.8%
Taylor expanded in x around 0 82.5%
mul-1-neg82.5%
Simplified82.5%
Taylor expanded in y around 0 81.5%
neg-mul-181.5%
Simplified81.5%
if 3.0000000000000001e-191 < x < 4.99999999999999979e27Initial program 74.6%
Taylor expanded in y around 0 99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
unpow299.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around inf 83.9%
mul-1-neg83.9%
distribute-rgt-neg-in83.9%
*-commutative83.9%
associate-*l*83.9%
unpow283.9%
associate-*r*83.9%
distribute-lft-in84.0%
sub-neg84.0%
metadata-eval84.0%
associate-*r*84.0%
unpow284.0%
*-commutative84.0%
+-commutative84.0%
sub-neg84.0%
unpow284.0%
Simplified84.0%
Final simplification87.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t)))
(if (<= x -2.8e+27)
t_1
(if (<= x 7.4e-191)
(- (- y (log y)) t)
(if (<= x 7.5e+27) (- (* (+ z -1.0) (- (* -0.5 (* y y)) y)) t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - t;
double tmp;
if (x <= -2.8e+27) {
tmp = t_1;
} else if (x <= 7.4e-191) {
tmp = (y - log(y)) - t;
} else if (x <= 7.5e+27) {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - t
if (x <= (-2.8d+27)) then
tmp = t_1
else if (x <= 7.4d-191) then
tmp = (y - log(y)) - t
else if (x <= 7.5d+27) then
tmp = ((z + (-1.0d0)) * (((-0.5d0) * (y * y)) - y)) - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * Math.log(y)) - t;
double tmp;
if (x <= -2.8e+27) {
tmp = t_1;
} else if (x <= 7.4e-191) {
tmp = (y - Math.log(y)) - t;
} else if (x <= 7.5e+27) {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - t tmp = 0 if x <= -2.8e+27: tmp = t_1 elif x <= 7.4e-191: tmp = (y - math.log(y)) - t elif x <= 7.5e+27: tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -2.8e+27) tmp = t_1; elseif (x <= 7.4e-191) tmp = Float64(Float64(y - log(y)) - t); elseif (x <= 7.5e+27) tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - t; tmp = 0.0; if (x <= -2.8e+27) tmp = t_1; elseif (x <= 7.4e-191) tmp = (y - log(y)) - t; elseif (x <= 7.5e+27) tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -2.8e+27], t$95$1, If[LessEqual[x, 7.4e-191], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 7.5e+27], N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{-191}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+27}:\\
\;\;\;\;\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.7999999999999999e27 or 7.5000000000000002e27 < x Initial program 94.1%
Taylor expanded in y around 0 99.7%
Taylor expanded in x around inf 93.5%
if -2.7999999999999999e27 < x < 7.3999999999999994e-191Initial program 85.3%
Taylor expanded in z around 0 82.8%
sub-neg82.8%
metadata-eval82.8%
mul-1-neg82.8%
unsub-neg82.8%
*-commutative82.8%
+-commutative82.8%
sub-neg82.8%
mul-1-neg82.8%
log1p-def82.8%
mul-1-neg82.8%
Simplified82.8%
Taylor expanded in x around 0 82.5%
mul-1-neg82.5%
Simplified82.5%
Taylor expanded in y around 0 81.8%
neg-mul-181.8%
unsub-neg81.8%
Simplified81.8%
if 7.3999999999999994e-191 < x < 7.5000000000000002e27Initial program 74.6%
Taylor expanded in y around 0 99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
unpow299.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around inf 83.9%
mul-1-neg83.9%
distribute-rgt-neg-in83.9%
*-commutative83.9%
associate-*l*83.9%
unpow283.9%
associate-*r*83.9%
distribute-lft-in84.0%
sub-neg84.0%
metadata-eval84.0%
associate-*r*84.0%
unpow284.0%
*-commutative84.0%
+-commutative84.0%
sub-neg84.0%
unpow284.0%
Simplified84.0%
Final simplification87.4%
(FPCore (x y z t) :precision binary64 (if (<= z -1.06e+111) (- (* (+ z -1.0) (- (* -0.5 (* y y)) y)) t) (- (+ y (* (log y) (+ x -1.0))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.06e+111) {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
} else {
tmp = (y + (log(y) * (x + -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 (z <= (-1.06d+111)) then
tmp = ((z + (-1.0d0)) * (((-0.5d0) * (y * y)) - y)) - t
else
tmp = (y + (log(y) * (x + (-1.0d0)))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.06e+111) {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
} else {
tmp = (y + (Math.log(y) * (x + -1.0))) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.06e+111: tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t else: tmp = (y + (math.log(y) * (x + -1.0))) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.06e+111) tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t); else tmp = Float64(Float64(y + Float64(log(y) * Float64(x + -1.0))) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.06e+111) tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t; else tmp = (y + (log(y) * (x + -1.0))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.06e+111], N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y + N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+111}:\\
\;\;\;\;\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y + \log y \cdot \left(x + -1\right)\right) - t\\
\end{array}
\end{array}
if z < -1.06e111Initial program 59.1%
Taylor expanded in y around 0 98.1%
mul-1-neg98.1%
unsub-neg98.1%
*-commutative98.1%
unpow298.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in y around inf 68.8%
mul-1-neg68.8%
distribute-rgt-neg-in68.8%
*-commutative68.8%
associate-*l*68.8%
unpow268.8%
associate-*r*68.8%
distribute-lft-in68.9%
sub-neg68.9%
metadata-eval68.9%
associate-*r*68.9%
unpow268.9%
*-commutative68.9%
+-commutative68.9%
sub-neg68.9%
unpow268.9%
Simplified68.9%
if -1.06e111 < z Initial program 93.2%
Taylor expanded in z around 0 92.4%
sub-neg92.4%
metadata-eval92.4%
mul-1-neg92.4%
unsub-neg92.4%
*-commutative92.4%
+-commutative92.4%
sub-neg92.4%
mul-1-neg92.4%
log1p-def92.4%
mul-1-neg92.4%
Simplified92.4%
Taylor expanded in y around 0 92.0%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (<= z -1.06e+111) (- (* (+ z -1.0) (- (* -0.5 (* y y)) y)) t) (- (* (log y) (+ x -1.0)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.06e+111) {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
} else {
tmp = (log(y) * (x + -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 (z <= (-1.06d+111)) then
tmp = ((z + (-1.0d0)) * (((-0.5d0) * (y * y)) - y)) - t
else
tmp = (log(y) * (x + (-1.0d0))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.06e+111) {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
} else {
tmp = (Math.log(y) * (x + -1.0)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.06e+111: tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t else: tmp = (math.log(y) * (x + -1.0)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.06e+111) tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t); else tmp = Float64(Float64(log(y) * Float64(x + -1.0)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.06e+111) tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t; else tmp = (log(y) * (x + -1.0)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.06e+111], N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+111}:\\
\;\;\;\;\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(x + -1\right) - t\\
\end{array}
\end{array}
if z < -1.06e111Initial program 59.1%
Taylor expanded in y around 0 98.1%
mul-1-neg98.1%
unsub-neg98.1%
*-commutative98.1%
unpow298.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in y around inf 68.8%
mul-1-neg68.8%
distribute-rgt-neg-in68.8%
*-commutative68.8%
associate-*l*68.8%
unpow268.8%
associate-*r*68.8%
distribute-lft-in68.9%
sub-neg68.9%
metadata-eval68.9%
associate-*r*68.9%
unpow268.9%
*-commutative68.9%
+-commutative68.9%
sub-neg68.9%
unpow268.9%
Simplified68.9%
if -1.06e111 < z Initial program 93.2%
Taylor expanded in y around 0 91.7%
Final simplification87.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.7e+107) (not (<= z 6.5e+48))) (- (* (+ z -1.0) (- (* -0.5 (* y y)) y)) t) (- (- (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.7e+107) || !(z <= 6.5e+48)) {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
} 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 ((z <= (-2.7d+107)) .or. (.not. (z <= 6.5d+48))) then
tmp = ((z + (-1.0d0)) * (((-0.5d0) * (y * y)) - y)) - t
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 ((z <= -2.7e+107) || !(z <= 6.5e+48)) {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
} else {
tmp = -Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.7e+107) or not (z <= 6.5e+48): tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t else: tmp = -math.log(y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.7e+107) || !(z <= 6.5e+48)) tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t); else tmp = Float64(Float64(-log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.7e+107) || ~((z <= 6.5e+48))) tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t; else tmp = -log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.7e+107], N[Not[LessEqual[z, 6.5e+48]], $MachinePrecision]], N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+107} \lor \neg \left(z \leq 6.5 \cdot 10^{+48}\right):\\
\;\;\;\;\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\
\end{array}
\end{array}
if z < -2.7000000000000001e107 or 6.49999999999999972e48 < z Initial program 67.7%
Taylor expanded in y around 0 98.2%
mul-1-neg98.2%
unsub-neg98.2%
*-commutative98.2%
unpow298.2%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in y around inf 59.8%
mul-1-neg59.8%
distribute-rgt-neg-in59.8%
*-commutative59.8%
associate-*l*59.8%
unpow259.8%
associate-*r*59.8%
distribute-lft-in59.8%
sub-neg59.8%
metadata-eval59.8%
associate-*r*59.8%
unpow259.8%
*-commutative59.8%
+-commutative59.8%
sub-neg59.8%
unpow259.8%
Simplified59.8%
if -2.7000000000000001e107 < z < 6.49999999999999972e48Initial program 99.8%
Taylor expanded in z around 0 99.8%
sub-neg99.8%
metadata-eval99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
+-commutative99.8%
sub-neg99.8%
mul-1-neg99.8%
log1p-def99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 61.7%
mul-1-neg61.7%
Simplified61.7%
Taylor expanded in y around 0 60.8%
neg-mul-160.8%
Simplified60.8%
Final simplification60.4%
(FPCore (x y z t) :precision binary64 (if (<= t -8.5e-12) (- (* (* z y) (+ -1.0 (* y -0.5))) t) (if (<= t 8e-122) (- (log y)) (- (* (+ z -1.0) (- (* -0.5 (* y y)) y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.5e-12) {
tmp = ((z * y) * (-1.0 + (y * -0.5))) - t;
} else if (t <= 8e-122) {
tmp = -log(y);
} else {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-8.5d-12)) then
tmp = ((z * y) * ((-1.0d0) + (y * (-0.5d0)))) - t
else if (t <= 8d-122) then
tmp = -log(y)
else
tmp = ((z + (-1.0d0)) * (((-0.5d0) * (y * y)) - y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.5e-12) {
tmp = ((z * y) * (-1.0 + (y * -0.5))) - t;
} else if (t <= 8e-122) {
tmp = -Math.log(y);
} else {
tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -8.5e-12: tmp = ((z * y) * (-1.0 + (y * -0.5))) - t elif t <= 8e-122: tmp = -math.log(y) else: tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -8.5e-12) tmp = Float64(Float64(Float64(z * y) * Float64(-1.0 + Float64(y * -0.5))) - t); elseif (t <= 8e-122) tmp = Float64(-log(y)); else tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -8.5e-12) tmp = ((z * y) * (-1.0 + (y * -0.5))) - t; elseif (t <= 8e-122) tmp = -log(y); else tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -8.5e-12], N[(N[(N[(z * y), $MachinePrecision] * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 8e-122], (-N[Log[y], $MachinePrecision]), N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-12}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \left(-1 + y \cdot -0.5\right) - t\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-122}:\\
\;\;\;\;-\log y\\
\mathbf{else}:\\
\;\;\;\;\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\
\end{array}
\end{array}
if t < -8.4999999999999997e-12Initial program 95.5%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
unpow299.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around inf 70.0%
*-commutative70.0%
sub-neg70.0%
+-commutative70.0%
*-commutative70.0%
unpow270.0%
associate-*r*70.0%
distribute-lft-in70.0%
distribute-rgt-neg-in70.0%
*-commutative70.0%
mul-1-neg70.0%
*-commutative70.0%
associate-*r*70.0%
*-commutative70.0%
distribute-lft-out70.0%
*-commutative70.0%
Simplified70.0%
if -8.4999999999999997e-12 < t < 8.00000000000000047e-122Initial program 83.3%
Taylor expanded in z around 0 80.3%
sub-neg80.3%
metadata-eval80.3%
mul-1-neg80.3%
unsub-neg80.3%
*-commutative80.3%
+-commutative80.3%
sub-neg80.3%
mul-1-neg80.3%
log1p-def80.3%
mul-1-neg80.3%
Simplified80.3%
Taylor expanded in x around 0 38.0%
mul-1-neg38.0%
Simplified38.0%
Taylor expanded in y around 0 37.8%
neg-mul-137.8%
Simplified37.8%
Taylor expanded in t around 0 37.8%
neg-mul-137.8%
Simplified37.8%
if 8.00000000000000047e-122 < t Initial program 86.1%
Taylor expanded in y around 0 98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
unpow298.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in y around inf 57.8%
mul-1-neg57.8%
distribute-rgt-neg-in57.8%
*-commutative57.8%
associate-*l*57.8%
unpow257.8%
associate-*r*57.8%
distribute-lft-in57.8%
sub-neg57.8%
metadata-eval57.8%
associate-*r*57.8%
unpow257.8%
*-commutative57.8%
+-commutative57.8%
sub-neg57.8%
unpow257.8%
Simplified57.8%
Final simplification53.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.0063) (not (<= t 1.85e+59))) (- (* (* y y) (+ 0.5 (* z -0.5))) t) (* z (- (* -0.5 (* y y)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.0063) || !(t <= 1.85e+59)) {
tmp = ((y * y) * (0.5 + (z * -0.5))) - t;
} else {
tmp = z * ((-0.5 * (y * y)) - y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-0.0063d0)) .or. (.not. (t <= 1.85d+59))) then
tmp = ((y * y) * (0.5d0 + (z * (-0.5d0)))) - t
else
tmp = z * (((-0.5d0) * (y * y)) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.0063) || !(t <= 1.85e+59)) {
tmp = ((y * y) * (0.5 + (z * -0.5))) - t;
} else {
tmp = z * ((-0.5 * (y * y)) - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -0.0063) or not (t <= 1.85e+59): tmp = ((y * y) * (0.5 + (z * -0.5))) - t else: tmp = z * ((-0.5 * (y * y)) - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -0.0063) || !(t <= 1.85e+59)) tmp = Float64(Float64(Float64(y * y) * Float64(0.5 + Float64(z * -0.5))) - t); else tmp = Float64(z * Float64(Float64(-0.5 * Float64(y * y)) - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -0.0063) || ~((t <= 1.85e+59))) tmp = ((y * y) * (0.5 + (z * -0.5))) - t; else tmp = z * ((-0.5 * (y * y)) - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -0.0063], N[Not[LessEqual[t, 1.85e+59]], $MachinePrecision]], N[(N[(N[(y * y), $MachinePrecision] * N[(0.5 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(z * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0063 \lor \neg \left(t \leq 1.85 \cdot 10^{+59}\right):\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right)\\
\end{array}
\end{array}
if t < -0.0063 or 1.84999999999999999e59 < t Initial program 96.4%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
unpow299.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around inf 70.6%
associate-*r*70.6%
*-commutative70.6%
unpow270.6%
sub-neg70.6%
metadata-eval70.6%
+-commutative70.6%
distribute-rgt-in70.6%
metadata-eval70.6%
Simplified70.6%
if -0.0063 < t < 1.84999999999999999e59Initial program 80.8%
Taylor expanded in y around 0 98.8%
Taylor expanded in x around 0 54.4%
mul-1-neg54.4%
Simplified54.4%
Taylor expanded in z around inf 22.7%
Taylor expanded in y around 0 22.1%
neg-mul-122.1%
sub-neg22.1%
unpow222.1%
Simplified22.1%
Final simplification42.9%
(FPCore (x y z t) :precision binary64 (if (<= t -0.0033) (- t) (if (<= t 1.85e+59) (* z (- (* -0.5 (* y y)) y)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.0033) {
tmp = -t;
} else if (t <= 1.85e+59) {
tmp = z * ((-0.5 * (y * y)) - y);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-0.0033d0)) then
tmp = -t
else if (t <= 1.85d+59) then
tmp = z * (((-0.5d0) * (y * y)) - y)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.0033) {
tmp = -t;
} else if (t <= 1.85e+59) {
tmp = z * ((-0.5 * (y * y)) - y);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -0.0033: tmp = -t elif t <= 1.85e+59: tmp = z * ((-0.5 * (y * y)) - y) else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -0.0033) tmp = Float64(-t); elseif (t <= 1.85e+59) tmp = Float64(z * Float64(Float64(-0.5 * Float64(y * y)) - y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -0.0033) tmp = -t; elseif (t <= 1.85e+59) tmp = z * ((-0.5 * (y * y)) - y); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -0.0033], (-t), If[LessEqual[t, 1.85e+59], N[(z * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0033:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{+59}:\\
\;\;\;\;z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -0.0033 or 1.84999999999999999e59 < t Initial program 96.4%
+-commutative96.4%
associate--l+96.4%
fma-def96.4%
sub-neg96.4%
log1p-def99.9%
Simplified99.9%
Taylor expanded in t around inf 70.5%
neg-mul-170.5%
Simplified70.5%
if -0.0033 < t < 1.84999999999999999e59Initial program 80.8%
Taylor expanded in y around 0 98.8%
Taylor expanded in x around 0 54.4%
mul-1-neg54.4%
Simplified54.4%
Taylor expanded in z around inf 22.7%
Taylor expanded in y around 0 22.1%
neg-mul-122.1%
sub-neg22.1%
unpow222.1%
Simplified22.1%
Final simplification42.9%
(FPCore (x y z t) :precision binary64 (- (* (+ z -1.0) (- (* -0.5 (* y y)) y)) t))
double code(double x, double y, double z, double t) {
return ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((z + (-1.0d0)) * (((-0.5d0) * (y * y)) - y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
}
def code(x, y, z, t): return ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(z + -1.0) * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t) end
function tmp = code(x, y, z, t) tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t
\end{array}
Initial program 87.5%
Taylor expanded in y around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
unpow298.9%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in y around inf 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
*-commutative46.1%
associate-*l*46.1%
unpow246.1%
associate-*r*46.1%
distribute-lft-in46.1%
sub-neg46.1%
metadata-eval46.1%
associate-*r*46.1%
unpow246.1%
*-commutative46.1%
+-commutative46.1%
sub-neg46.1%
unpow246.1%
Simplified46.1%
Final simplification46.1%
(FPCore (x y z t) :precision binary64 (- (* (* z y) (+ -1.0 (* y -0.5))) t))
double code(double x, double y, double z, double t) {
return ((z * 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 = ((z * y) * ((-1.0d0) + (y * (-0.5d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((z * y) * (-1.0 + (y * -0.5))) - t;
}
def code(x, y, z, t): return ((z * y) * (-1.0 + (y * -0.5))) - t
function code(x, y, z, t) return Float64(Float64(Float64(z * y) * Float64(-1.0 + Float64(y * -0.5))) - t) end
function tmp = code(x, y, z, t) tmp = ((z * y) * (-1.0 + (y * -0.5))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(z * y), $MachinePrecision] * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot y\right) \cdot \left(-1 + y \cdot -0.5\right) - t
\end{array}
Initial program 87.5%
Taylor expanded in y around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
unpow298.9%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in z around inf 45.9%
*-commutative45.9%
sub-neg45.9%
+-commutative45.9%
*-commutative45.9%
unpow245.9%
associate-*r*45.9%
distribute-lft-in45.9%
distribute-rgt-neg-in45.9%
*-commutative45.9%
mul-1-neg45.9%
*-commutative45.9%
associate-*r*45.9%
*-commutative45.9%
distribute-lft-out45.9%
*-commutative45.9%
Simplified45.9%
Final simplification45.9%
(FPCore (x y z t) :precision binary64 (if (<= t -0.007) (- t) (if (<= t 200000000.0) (* z (- y)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.007) {
tmp = -t;
} else if (t <= 200000000.0) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-0.007d0)) then
tmp = -t
else if (t <= 200000000.0d0) then
tmp = z * -y
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.007) {
tmp = -t;
} else if (t <= 200000000.0) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -0.007: tmp = -t elif t <= 200000000.0: tmp = z * -y else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -0.007) tmp = Float64(-t); elseif (t <= 200000000.0) tmp = Float64(z * Float64(-y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -0.007) tmp = -t; elseif (t <= 200000000.0) tmp = z * -y; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -0.007], (-t), If[LessEqual[t, 200000000.0], N[(z * (-y)), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.007:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 200000000:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -0.00700000000000000015 or 2e8 < t Initial program 94.5%
+-commutative94.5%
associate--l+94.5%
fma-def94.5%
sub-neg94.5%
log1p-def99.9%
Simplified99.9%
Taylor expanded in t around inf 64.5%
neg-mul-164.5%
Simplified64.5%
if -0.00700000000000000015 < t < 2e8Initial program 80.7%
Taylor expanded in y around 0 98.7%
Taylor expanded in x around 0 54.8%
mul-1-neg54.8%
Simplified54.8%
Taylor expanded in z around inf 22.2%
Taylor expanded in y around 0 20.9%
associate-*r*20.9%
neg-mul-120.9%
Simplified20.9%
Final simplification42.4%
(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 87.5%
+-commutative87.5%
associate--l+87.5%
fma-def87.5%
sub-neg87.5%
log1p-def99.8%
Simplified99.8%
Taylor expanded in t around inf 33.3%
neg-mul-133.3%
Simplified33.3%
Final simplification33.3%
herbie shell --seed 2023195
(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))