
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (fma (+ z -1.0) (log1p (- y)) (fma (+ -1.0 x) (log y) (- t))))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), fma((-1.0 + x), log(y), -t));
}
function code(x, y, z, t) return fma(Float64(z + -1.0), log1p(Float64(-y)), fma(Float64(-1.0 + x), log(y), Float64(-t))) end
code[x_, y_, z_, t_] := N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \mathsf{fma}\left(-1 + x, \log y, -t\right)\right)
\end{array}
Initial program 87.8%
sub-neg87.8%
+-commutative87.8%
associate-+l+87.8%
fma-define87.8%
sub-neg87.8%
metadata-eval87.8%
sub-neg87.8%
log1p-define99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (fma (+ 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 87.8%
+-commutative87.8%
fma-define87.8%
sub-neg87.8%
metadata-eval87.8%
sub-neg87.8%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (fma (- y) (+ z -1.0) (fma (log y) (+ -1.0 x) (- t))))
double code(double x, double y, double z, double t) {
return fma(-y, (z + -1.0), fma(log(y), (-1.0 + x), -t));
}
function code(x, y, z, t) return fma(Float64(-y), Float64(z + -1.0), fma(log(y), Float64(-1.0 + x), Float64(-t))) end
code[x_, y_, z_, t_] := N[((-y) * N[(z + -1.0), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-y, z + -1, \mathsf{fma}\left(\log y, -1 + x, -t\right)\right)
\end{array}
Initial program 87.8%
Taylor expanded in y around 0 99.2%
associate--l+99.2%
associate-*r*99.2%
mul-1-neg99.2%
fma-define99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
fma-neg99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t (log y))))
(if (<= x -2.9e+70)
t_1
(if (<= x -6e-124)
(- (* y (- (* y (* z (+ -0.5 (* y -0.3333333333333333)))) z)) t)
(if (<= x -4.7e-163)
t_2
(if (<= x 2.6e-212)
(- (- t) (* z y))
(if (<= x 5.8e-161)
t_2
(if (<= x 1.32e+142)
(- (* y (- (* -0.5 (* z y)) z)) t)
t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t - log(y);
double tmp;
if (x <= -2.9e+70) {
tmp = t_1;
} else if (x <= -6e-124) {
tmp = (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t;
} else if (x <= -4.7e-163) {
tmp = t_2;
} else if (x <= 2.6e-212) {
tmp = -t - (z * y);
} else if (x <= 5.8e-161) {
tmp = t_2;
} else if (x <= 1.32e+142) {
tmp = (y * ((-0.5 * (z * y)) - z)) - 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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t - log(y)
if (x <= (-2.9d+70)) then
tmp = t_1
else if (x <= (-6d-124)) then
tmp = (y * ((y * (z * ((-0.5d0) + (y * (-0.3333333333333333d0))))) - z)) - t
else if (x <= (-4.7d-163)) then
tmp = t_2
else if (x <= 2.6d-212) then
tmp = -t - (z * y)
else if (x <= 5.8d-161) then
tmp = t_2
else if (x <= 1.32d+142) then
tmp = (y * (((-0.5d0) * (z * y)) - z)) - 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);
double t_2 = t - Math.log(y);
double tmp;
if (x <= -2.9e+70) {
tmp = t_1;
} else if (x <= -6e-124) {
tmp = (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t;
} else if (x <= -4.7e-163) {
tmp = t_2;
} else if (x <= 2.6e-212) {
tmp = -t - (z * y);
} else if (x <= 5.8e-161) {
tmp = t_2;
} else if (x <= 1.32e+142) {
tmp = (y * ((-0.5 * (z * y)) - z)) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t - math.log(y) tmp = 0 if x <= -2.9e+70: tmp = t_1 elif x <= -6e-124: tmp = (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t elif x <= -4.7e-163: tmp = t_2 elif x <= 2.6e-212: tmp = -t - (z * y) elif x <= 5.8e-161: tmp = t_2 elif x <= 1.32e+142: tmp = (y * ((-0.5 * (z * y)) - z)) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t - log(y)) tmp = 0.0 if (x <= -2.9e+70) tmp = t_1; elseif (x <= -6e-124) tmp = Float64(Float64(y * Float64(Float64(y * Float64(z * Float64(-0.5 + Float64(y * -0.3333333333333333)))) - z)) - t); elseif (x <= -4.7e-163) tmp = t_2; elseif (x <= 2.6e-212) tmp = Float64(Float64(-t) - Float64(z * y)); elseif (x <= 5.8e-161) tmp = t_2; elseif (x <= 1.32e+142) tmp = Float64(Float64(y * Float64(Float64(-0.5 * Float64(z * y)) - z)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t - log(y); tmp = 0.0; if (x <= -2.9e+70) tmp = t_1; elseif (x <= -6e-124) tmp = (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t; elseif (x <= -4.7e-163) tmp = t_2; elseif (x <= 2.6e-212) tmp = -t - (z * y); elseif (x <= 5.8e-161) tmp = t_2; elseif (x <= 1.32e+142) tmp = (y * ((-0.5 * (z * y)) - z)) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t - N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9e+70], t$95$1, If[LessEqual[x, -6e-124], N[(N[(y * N[(N[(y * N[(z * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, -4.7e-163], t$95$2, If[LessEqual[x, 2.6e-212], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.8e-161], t$95$2, If[LessEqual[x, 1.32e+142], N[(N[(y * N[(N[(-0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t - \log y\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-124}:\\
\;\;\;\;y \cdot \left(y \cdot \left(z \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right) - z\right) - t\\
\mathbf{elif}\;x \leq -4.7 \cdot 10^{-163}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-212}:\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-161}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{+142}:\\
\;\;\;\;y \cdot \left(-0.5 \cdot \left(z \cdot y\right) - z\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.8999999999999998e70 or 1.3199999999999999e142 < x Initial program 95.0%
Taylor expanded in y around 0 93.9%
fma-neg93.9%
sub-neg93.9%
metadata-eval93.9%
+-commutative93.9%
Simplified93.9%
Taylor expanded in x around inf 78.3%
*-commutative78.3%
Simplified78.3%
if -2.8999999999999998e70 < x < -6e-124Initial program 91.1%
Taylor expanded in z around inf 63.7%
*-commutative63.7%
sub-neg63.7%
log1p-define72.6%
Simplified72.6%
Taylor expanded in y around 0 72.5%
Taylor expanded in y around 0 72.5%
+-commutative72.5%
associate-*r*72.5%
distribute-rgt-out72.5%
*-commutative72.5%
Simplified72.5%
if -6e-124 < x < -4.7e-163 or 2.6e-212 < x < 5.8e-161Initial program 87.1%
Taylor expanded in y around 0 87.1%
fma-neg87.1%
sub-neg87.1%
metadata-eval87.1%
+-commutative87.1%
Simplified87.1%
add-cube-cbrt85.5%
pow385.6%
add-sqr-sqrt44.3%
sqrt-unprod80.5%
sqr-neg80.5%
sqrt-unprod36.1%
add-sqr-sqrt75.4%
Applied egg-rr75.4%
Taylor expanded in x around 0 76.6%
neg-mul-176.6%
unsub-neg76.6%
Simplified76.6%
if -4.7e-163 < x < 2.6e-212Initial program 80.2%
Taylor expanded in z around inf 46.8%
*-commutative46.8%
sub-neg46.8%
log1p-define66.2%
Simplified66.2%
Taylor expanded in y around 0 66.2%
associate-*r*66.2%
mul-1-neg66.2%
Simplified66.2%
if 5.8e-161 < x < 1.3199999999999999e142Initial program 83.0%
Taylor expanded in z around inf 53.9%
*-commutative53.9%
sub-neg53.9%
log1p-define68.7%
Simplified68.7%
Taylor expanded in y around 0 68.7%
+-commutative68.7%
mul-1-neg68.7%
unsub-neg68.7%
*-commutative68.7%
Simplified68.7%
Final simplification72.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= (+ -1.0 x) -5e+70)
t_1
(if (<= (+ -1.0 x) -0.999999999998)
(- (- t) (log y))
(if (<= (+ -1.0 x) 2e+142) (- (- t) (* z y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if ((-1.0 + x) <= -5e+70) {
tmp = t_1;
} else if ((-1.0 + x) <= -0.999999999998) {
tmp = -t - log(y);
} else if ((-1.0 + x) <= 2e+142) {
tmp = -t - (z * y);
} 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)
if (((-1.0d0) + x) <= (-5d+70)) then
tmp = t_1
else if (((-1.0d0) + x) <= (-0.999999999998d0)) then
tmp = -t - log(y)
else if (((-1.0d0) + x) <= 2d+142) then
tmp = -t - (z * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if ((-1.0 + x) <= -5e+70) {
tmp = t_1;
} else if ((-1.0 + x) <= -0.999999999998) {
tmp = -t - Math.log(y);
} else if ((-1.0 + x) <= 2e+142) {
tmp = -t - (z * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if (-1.0 + x) <= -5e+70: tmp = t_1 elif (-1.0 + x) <= -0.999999999998: tmp = -t - math.log(y) elif (-1.0 + x) <= 2e+142: tmp = -t - (z * y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (Float64(-1.0 + x) <= -5e+70) tmp = t_1; elseif (Float64(-1.0 + x) <= -0.999999999998) tmp = Float64(Float64(-t) - log(y)); elseif (Float64(-1.0 + x) <= 2e+142) tmp = Float64(Float64(-t) - Float64(z * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if ((-1.0 + x) <= -5e+70) tmp = t_1; elseif ((-1.0 + x) <= -0.999999999998) tmp = -t - log(y); elseif ((-1.0 + x) <= 2e+142) tmp = -t - (z * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(-1.0 + x), $MachinePrecision], -5e+70], t$95$1, If[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.999999999998], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 2e+142], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;-1 + x \leq -5 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;-1 + x \leq -0.999999999998:\\
\;\;\;\;\left(-t\right) - \log y\\
\mathbf{elif}\;-1 + x \leq 2 \cdot 10^{+142}:\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 x 1) < -5.0000000000000002e70 or 2.0000000000000001e142 < (-.f64 x 1) Initial program 95.0%
Taylor expanded in y around 0 93.9%
fma-neg93.9%
sub-neg93.9%
metadata-eval93.9%
+-commutative93.9%
Simplified93.9%
Taylor expanded in x around inf 78.3%
*-commutative78.3%
Simplified78.3%
if -5.0000000000000002e70 < (-.f64 x 1) < -0.99999999999800004Initial program 84.8%
Taylor expanded in y around 0 83.8%
fma-neg83.8%
sub-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in x around 0 80.9%
mul-1-neg80.9%
Simplified80.9%
if -0.99999999999800004 < (-.f64 x 1) < 2.0000000000000001e142Initial program 81.8%
Taylor expanded in z around inf 56.1%
*-commutative56.1%
sub-neg56.1%
log1p-define74.1%
Simplified74.1%
Taylor expanded in y around 0 74.1%
associate-*r*74.1%
mul-1-neg74.1%
Simplified74.1%
Final simplification79.2%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -1.00000001)
(- (* (log y) (+ -1.0 x)) t)
(if (<= (+ -1.0 x) 5e+29)
(- (- (* y (- 1.0 z)) (log y)) t)
(- (* x (log y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -1.00000001) {
tmp = (log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 5e+29) {
tmp = ((y * (1.0 - z)) - log(y)) - t;
} else {
tmp = (x * log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((-1.0d0) + x) <= (-1.00000001d0)) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else if (((-1.0d0) + x) <= 5d+29) then
tmp = ((y * (1.0d0 - z)) - log(y)) - t
else
tmp = (x * log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -1.00000001) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 5e+29) {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
} else {
tmp = (x * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -1.00000001: tmp = (math.log(y) * (-1.0 + x)) - t elif (-1.0 + x) <= 5e+29: tmp = ((y * (1.0 - z)) - math.log(y)) - t else: tmp = (x * math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -1.00000001) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); elseif (Float64(-1.0 + x) <= 5e+29) tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); else tmp = Float64(Float64(x * log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -1.00000001) tmp = (log(y) * (-1.0 + x)) - t; elseif ((-1.0 + x) <= 5e+29) tmp = ((y * (1.0 - z)) - log(y)) - t; else tmp = (x * log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.00000001], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 5e+29], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -1.00000001:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{elif}\;-1 + x \leq 5 \cdot 10^{+29}:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -1.0000000099999999Initial program 94.3%
Taylor expanded in y around 0 93.4%
if -1.0000000099999999 < (-.f64 x 1) < 5.0000000000000001e29Initial program 82.8%
Taylor expanded in y around 0 99.6%
associate--l+99.6%
associate-*r*99.6%
mul-1-neg99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
fma-neg99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 98.1%
+-commutative98.1%
mul-1-neg98.1%
unsub-neg98.1%
sub-neg98.1%
metadata-eval98.1%
+-commutative98.1%
neg-mul-198.1%
distribute-rgt-neg-in98.1%
distribute-neg-in98.1%
metadata-eval98.1%
unsub-neg98.1%
Simplified98.1%
if 5.0000000000000001e29 < (-.f64 x 1) Initial program 93.0%
Taylor expanded in x around inf 93.0%
associate--l+93.0%
+-commutative93.0%
associate--l+93.0%
associate-/l*93.0%
sub-neg93.0%
log1p-define99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
associate-*r/99.6%
div-sub99.6%
mul-1-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 91.3%
neg-mul-191.3%
distribute-neg-frac291.3%
Simplified91.3%
Taylor expanded in x around 0 91.3%
neg-mul-191.3%
+-commutative91.3%
unsub-neg91.3%
*-commutative91.3%
Simplified91.3%
Final simplification95.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) (+ -1.0 x))))
(if (<= t -0.00038)
(* t (+ -1.0 (* (log y) (/ (+ -1.0 x) t))))
(if (<= t 3.4e-9) (+ (* y (- 1.0 z)) t_1) (- 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 <= -0.00038) {
tmp = t * (-1.0 + (log(y) * ((-1.0 + x) / t)));
} else if (t <= 3.4e-9) {
tmp = (y * (1.0 - z)) + t_1;
} else {
tmp = 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 <= (-0.00038d0)) then
tmp = t * ((-1.0d0) + (log(y) * (((-1.0d0) + x) / t)))
else if (t <= 3.4d-9) then
tmp = (y * (1.0d0 - z)) + t_1
else
tmp = 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 <= -0.00038) {
tmp = t * (-1.0 + (Math.log(y) * ((-1.0 + x) / t)));
} else if (t <= 3.4e-9) {
tmp = (y * (1.0 - z)) + t_1;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * (-1.0 + x) tmp = 0 if t <= -0.00038: tmp = t * (-1.0 + (math.log(y) * ((-1.0 + x) / t))) elif t <= 3.4e-9: tmp = (y * (1.0 - z)) + t_1 else: tmp = 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 <= -0.00038) tmp = Float64(t * Float64(-1.0 + Float64(log(y) * Float64(Float64(-1.0 + x) / t)))); elseif (t <= 3.4e-9) tmp = Float64(Float64(y * Float64(1.0 - z)) + t_1); else tmp = Float64(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 <= -0.00038) tmp = t * (-1.0 + (log(y) * ((-1.0 + x) / t))); elseif (t <= 3.4e-9) tmp = (y * (1.0 - z)) + t_1; else tmp = 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, -0.00038], N[(t * N[(-1.0 + N[(N[Log[y], $MachinePrecision] * N[(N[(-1.0 + x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e-9], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(-1 + x\right)\\
\mathbf{if}\;t \leq -0.00038:\\
\;\;\;\;t \cdot \left(-1 + \log y \cdot \frac{-1 + x}{t}\right)\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-9}:\\
\;\;\;\;y \cdot \left(1 - z\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < -3.8000000000000002e-4Initial program 97.2%
Taylor expanded in y around 0 96.3%
fma-neg96.3%
sub-neg96.3%
metadata-eval96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in t around inf 96.3%
sub-neg96.3%
associate-/l*96.3%
sub-neg96.3%
metadata-eval96.3%
metadata-eval96.3%
Simplified96.3%
if -3.8000000000000002e-4 < t < 3.3999999999999998e-9Initial program 80.2%
Taylor expanded in y around 0 99.1%
associate--l+99.1%
associate-*r*99.1%
mul-1-neg99.1%
fma-define99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
fma-neg99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in t around 0 98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
neg-mul-198.8%
distribute-rgt-neg-in98.8%
distribute-neg-in98.8%
metadata-eval98.8%
unsub-neg98.8%
sub-neg98.8%
metadata-eval98.8%
Simplified98.8%
if 3.3999999999999998e-9 < t Initial program 91.5%
Taylor expanded in y around 0 90.8%
Final simplification95.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -4e+15) (not (<= (+ -1.0 x) -0.5))) (- (* x (log y)) t) (- (- t) (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -4e+15) || !((-1.0 + x) <= -0.5)) {
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 ((((-1.0d0) + x) <= (-4d+15)) .or. (.not. (((-1.0d0) + x) <= (-0.5d0)))) 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 (((-1.0 + x) <= -4e+15) || !((-1.0 + x) <= -0.5)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = -t - Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -4e+15) or not ((-1.0 + x) <= -0.5): tmp = (x * math.log(y)) - t else: tmp = -t - math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -4e+15) || !(Float64(-1.0 + x) <= -0.5)) 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 (((-1.0 + x) <= -4e+15) || ~(((-1.0 + x) <= -0.5))) tmp = (x * log(y)) - t; else tmp = -t - log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -4e+15], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.5]], $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}\;-1 + x \leq -4 \cdot 10^{+15} \lor \neg \left(-1 + x \leq -0.5\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - \log y\\
\end{array}
\end{array}
if (-.f64 x 1) < -4e15 or -0.5 < (-.f64 x 1) Initial program 92.1%
Taylor expanded in x around inf 92.1%
associate--l+92.1%
+-commutative92.1%
associate--l+92.1%
associate-/l*92.1%
sub-neg92.1%
log1p-define99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
associate-*r/99.6%
div-sub99.6%
mul-1-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 90.8%
neg-mul-190.8%
distribute-neg-frac290.8%
Simplified90.8%
Taylor expanded in x around 0 90.8%
neg-mul-190.8%
+-commutative90.8%
unsub-neg90.8%
*-commutative90.8%
Simplified90.8%
if -4e15 < (-.f64 x 1) < -0.5Initial program 84.0%
Taylor expanded in y around 0 83.4%
fma-neg83.4%
sub-neg83.4%
metadata-eval83.4%
+-commutative83.4%
Simplified83.4%
Taylor expanded in x around 0 81.9%
mul-1-neg81.9%
Simplified81.9%
Final simplification86.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.4e+171) (not (<= z 1.45e+133))) (- (* z (log1p (- y))) t) (- (* (log y) (+ -1.0 x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.4e+171) || !(z <= 1.45e+133)) {
tmp = (z * log1p(-y)) - t;
} else {
tmp = (log(y) * (-1.0 + x)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.4e+171) || !(z <= 1.45e+133)) {
tmp = (z * Math.log1p(-y)) - t;
} else {
tmp = (Math.log(y) * (-1.0 + x)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.4e+171) or not (z <= 1.45e+133): tmp = (z * math.log1p(-y)) - t else: tmp = (math.log(y) * (-1.0 + x)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.4e+171) || !(z <= 1.45e+133)) tmp = Float64(Float64(z * log1p(Float64(-y))) - t); else tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.4e+171], N[Not[LessEqual[z, 1.45e+133]], $MachinePrecision]], N[(N[(z * N[Log[1 + (-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}\;z \leq -5.4 \cdot 10^{+171} \lor \neg \left(z \leq 1.45 \cdot 10^{+133}\right):\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\end{array}
\end{array}
if z < -5.3999999999999996e171 or 1.4500000000000001e133 < z Initial program 53.7%
Taylor expanded in z around inf 38.8%
*-commutative38.8%
sub-neg38.8%
log1p-define82.2%
Simplified82.2%
if -5.3999999999999996e171 < z < 1.4500000000000001e133Initial program 98.0%
Taylor expanded in y around 0 98.0%
Final simplification94.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.06e+68) (not (<= x 1.95e+142))) (* x (log y)) (- (* y (- (* y (* z (+ -0.5 (* y -0.3333333333333333)))) z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.06e+68) || !(x <= 1.95e+142)) {
tmp = x * log(y);
} else {
tmp = (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.06d+68)) .or. (.not. (x <= 1.95d+142))) then
tmp = x * log(y)
else
tmp = (y * ((y * (z * ((-0.5d0) + (y * (-0.3333333333333333d0))))) - z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.06e+68) || !(x <= 1.95e+142)) {
tmp = x * Math.log(y);
} else {
tmp = (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.06e+68) or not (x <= 1.95e+142): tmp = x * math.log(y) else: tmp = (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.06e+68) || !(x <= 1.95e+142)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(y * Float64(Float64(y * Float64(z * Float64(-0.5 + Float64(y * -0.3333333333333333)))) - z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.06e+68) || ~((x <= 1.95e+142))) tmp = x * log(y); else tmp = (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.06e+68], N[Not[LessEqual[x, 1.95e+142]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(N[(y * N[(z * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{+68} \lor \neg \left(x \leq 1.95 \cdot 10^{+142}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot \left(z \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right) - z\right) - t\\
\end{array}
\end{array}
if x < -1.06e68 or 1.95e142 < x Initial program 95.0%
Taylor expanded in y around 0 93.9%
fma-neg93.9%
sub-neg93.9%
metadata-eval93.9%
+-commutative93.9%
Simplified93.9%
Taylor expanded in x around inf 78.3%
*-commutative78.3%
Simplified78.3%
if -1.06e68 < x < 1.95e142Initial program 84.2%
Taylor expanded in z around inf 48.9%
*-commutative48.9%
sub-neg48.9%
log1p-define63.4%
Simplified63.4%
Taylor expanded in y around 0 63.4%
Taylor expanded in y around 0 63.4%
+-commutative63.4%
associate-*r*63.4%
distribute-rgt-out63.4%
*-commutative63.4%
Simplified63.4%
Final simplification68.4%
(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 87.8%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
fma-define99.2%
mul-1-neg99.2%
fma-neg99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (- (* y (* z (+ -1.0 (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5))))) t))
double code(double x, double y, double z, double t) {
return (y * (z * (-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 = (y * (z * ((-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 (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t;
}
def code(x, y, z, t): return (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(z * 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 = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(z * 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] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(z \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right) - t
\end{array}
Initial program 87.8%
Taylor expanded in z around inf 38.1%
*-commutative38.1%
sub-neg38.1%
log1p-define49.1%
Simplified49.1%
Taylor expanded in y around 0 48.9%
Taylor expanded in z around 0 48.9%
Final simplification48.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.00105) (not (<= t 1550000.0))) (- t) (* y (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.00105) || !(t <= 1550000.0)) {
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 <= (-0.00105d0)) .or. (.not. (t <= 1550000.0d0))) 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 <= -0.00105) || !(t <= 1550000.0)) {
tmp = -t;
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -0.00105) or not (t <= 1550000.0): tmp = -t else: tmp = y * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -0.00105) || !(t <= 1550000.0)) 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 <= -0.00105) || ~((t <= 1550000.0))) tmp = -t; else tmp = y * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -0.00105], N[Not[LessEqual[t, 1550000.0]], $MachinePrecision]], (-t), N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.00105 \lor \neg \left(t \leq 1550000\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if t < -0.00104999999999999994 or 1.55e6 < t Initial program 94.1%
Taylor expanded in t around inf 67.3%
mul-1-neg67.3%
Simplified67.3%
if -0.00104999999999999994 < t < 1.55e6Initial program 80.7%
Taylor expanded in y around 0 99.1%
associate--l+99.1%
associate-*r*99.1%
mul-1-neg99.1%
fma-define99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
fma-neg99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in y around inf 20.7%
sub-neg20.7%
metadata-eval20.7%
+-commutative20.7%
neg-mul-120.7%
distribute-rgt-neg-in20.7%
distribute-neg-in20.7%
metadata-eval20.7%
unsub-neg20.7%
Simplified20.7%
Final simplification45.5%
(FPCore (x y z t) :precision binary64 (- (* y (- (* y (* z (+ -0.5 (* y -0.3333333333333333)))) z)) t))
double code(double x, double y, double z, double t) {
return (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - 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 * ((y * (z * ((-0.5d0) + (y * (-0.3333333333333333d0))))) - z)) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t;
}
def code(x, y, z, t): return (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(Float64(y * Float64(z * Float64(-0.5 + Float64(y * -0.3333333333333333)))) - z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z)) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(N[(y * N[(z * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(y \cdot \left(z \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right) - z\right) - t
\end{array}
Initial program 87.8%
Taylor expanded in z around inf 38.1%
*-commutative38.1%
sub-neg38.1%
log1p-define49.1%
Simplified49.1%
Taylor expanded in y around 0 48.9%
Taylor expanded in y around 0 48.9%
+-commutative48.9%
associate-*r*48.9%
distribute-rgt-out48.9%
*-commutative48.9%
Simplified48.9%
Final simplification48.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.00105) (not (<= t 6700000.0))) (- t) (* z (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.00105) || !(t <= 6700000.0)) {
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 <= (-0.00105d0)) .or. (.not. (t <= 6700000.0d0))) 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 <= -0.00105) || !(t <= 6700000.0)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -0.00105) or not (t <= 6700000.0): tmp = -t else: tmp = z * -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -0.00105) || !(t <= 6700000.0)) 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 <= -0.00105) || ~((t <= 6700000.0))) tmp = -t; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -0.00105], N[Not[LessEqual[t, 6700000.0]], $MachinePrecision]], (-t), N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.00105 \lor \neg \left(t \leq 6700000\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < -0.00104999999999999994 or 6.7e6 < t Initial program 94.1%
Taylor expanded in t around inf 67.3%
mul-1-neg67.3%
Simplified67.3%
if -0.00104999999999999994 < t < 6.7e6Initial program 80.7%
Taylor expanded in y around 0 99.1%
associate--l+99.1%
associate-*r*99.1%
mul-1-neg99.1%
fma-define99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
fma-neg99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in z around inf 20.2%
associate-*r*20.2%
mul-1-neg20.2%
Simplified20.2%
Final simplification45.2%
(FPCore (x y z t) :precision binary64 (- (* y (- (* -0.5 (* z y)) z)) t))
double code(double x, double y, double z, double t) {
return (y * ((-0.5 * (z * y)) - z)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * (((-0.5d0) * (z * y)) - z)) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * ((-0.5 * (z * y)) - z)) - t;
}
def code(x, y, z, t): return (y * ((-0.5 * (z * y)) - z)) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(Float64(-0.5 * Float64(z * y)) - z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * ((-0.5 * (z * y)) - z)) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(N[(-0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-0.5 \cdot \left(z \cdot y\right) - z\right) - t
\end{array}
Initial program 87.8%
Taylor expanded in z around inf 38.1%
*-commutative38.1%
sub-neg38.1%
log1p-define49.1%
Simplified49.1%
Taylor expanded in y around 0 48.9%
+-commutative48.9%
mul-1-neg48.9%
unsub-neg48.9%
*-commutative48.9%
Simplified48.9%
Final simplification48.9%
(FPCore (x y z t) :precision binary64 (- (- t) (* z y)))
double code(double x, double y, double z, double t) {
return -t - (z * 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 = -t - (z * y)
end function
public static double code(double x, double y, double z, double t) {
return -t - (z * y);
}
def code(x, y, z, t): return -t - (z * y)
function code(x, y, z, t) return Float64(Float64(-t) - Float64(z * y)) end
function tmp = code(x, y, z, t) tmp = -t - (z * y); end
code[x_, y_, z_, t_] := N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-t\right) - z \cdot y
\end{array}
Initial program 87.8%
Taylor expanded in z around inf 38.1%
*-commutative38.1%
sub-neg38.1%
log1p-define49.1%
Simplified49.1%
Taylor expanded in y around 0 48.5%
associate-*r*48.5%
mul-1-neg48.5%
Simplified48.5%
Final simplification48.5%
(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.8%
Taylor expanded in t around inf 37.1%
mul-1-neg37.1%
Simplified37.1%
Final simplification37.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 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.8%
Taylor expanded in y around 0 86.9%
fma-neg86.9%
sub-neg86.9%
metadata-eval86.9%
+-commutative86.9%
Simplified86.9%
add-cube-cbrt85.4%
pow385.4%
add-sqr-sqrt43.0%
sqrt-unprod51.9%
sqr-neg51.9%
sqrt-unprod24.0%
add-sqr-sqrt48.7%
Applied egg-rr48.7%
Taylor expanded in t around inf 2.1%
Final simplification2.1%
herbie shell --seed 2024096
(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))