
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (fma (+ z -1.0) (log1p (- y)) (fma (+ -1.0 x) (log y) (- t))))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), fma((-1.0 + x), log(y), -t));
}
function code(x, y, z, t) return fma(Float64(z + -1.0), log1p(Float64(-y)), fma(Float64(-1.0 + x), log(y), Float64(-t))) end
code[x_, y_, z_, t_] := N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \mathsf{fma}\left(-1 + x, \log y, -t\right)\right)
\end{array}
Initial program 91.4%
sub-neg91.4%
+-commutative91.4%
associate-+l+91.4%
fma-define91.4%
sub-neg91.4%
metadata-eval91.4%
sub-neg91.4%
log1p-define99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (- (fma (+ z -1.0) (log1p (- y)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), (log(y) * (-1.0 + x))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 91.4%
+-commutative91.4%
fma-define91.4%
sub-neg91.4%
metadata-eval91.4%
sub-neg91.4%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (log y) (+ -1.0 x))
(*
(+ z -1.0)
(* y (+ -1.0 (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5))))))
t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * ((y * ((y * (-0.25d0)) - 0.3333333333333333d0)) - 0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * Float64(Float64(y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * N[(N[(y * N[(N[(y * -0.25), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 91.4%
Taylor expanded in y around 0 99.7%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (- y (log y)) t)) (t_2 (- (* x (log y)) t)))
(if (<= x -10000000000.0)
t_2
(if (<= x -1.16e-214)
t_1
(if (<= x -6.2e-287)
(- (* y (* z (+ -1.0 (* y -0.5)))) t)
(if (<= x 6.3e-53) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - log(y)) - t;
double t_2 = (x * log(y)) - t;
double tmp;
if (x <= -10000000000.0) {
tmp = t_2;
} else if (x <= -1.16e-214) {
tmp = t_1;
} else if (x <= -6.2e-287) {
tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
} else if (x <= 6.3e-53) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y - log(y)) - t
t_2 = (x * log(y)) - t
if (x <= (-10000000000.0d0)) then
tmp = t_2
else if (x <= (-1.16d-214)) then
tmp = t_1
else if (x <= (-6.2d-287)) then
tmp = (y * (z * ((-1.0d0) + (y * (-0.5d0))))) - t
else if (x <= 6.3d-53) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - Math.log(y)) - t;
double t_2 = (x * Math.log(y)) - t;
double tmp;
if (x <= -10000000000.0) {
tmp = t_2;
} else if (x <= -1.16e-214) {
tmp = t_1;
} else if (x <= -6.2e-287) {
tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
} else if (x <= 6.3e-53) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - math.log(y)) - t t_2 = (x * math.log(y)) - t tmp = 0 if x <= -10000000000.0: tmp = t_2 elif x <= -1.16e-214: tmp = t_1 elif x <= -6.2e-287: tmp = (y * (z * (-1.0 + (y * -0.5)))) - t elif x <= 6.3e-53: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - log(y)) - t) t_2 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -10000000000.0) tmp = t_2; elseif (x <= -1.16e-214) tmp = t_1; elseif (x <= -6.2e-287) tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - t); elseif (x <= 6.3e-53) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - log(y)) - t; t_2 = (x * log(y)) - t; tmp = 0.0; if (x <= -10000000000.0) tmp = t_2; elseif (x <= -1.16e-214) tmp = t_1; elseif (x <= -6.2e-287) tmp = (y * (z * (-1.0 + (y * -0.5)))) - t; elseif (x <= 6.3e-53) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -10000000000.0], t$95$2, If[LessEqual[x, -1.16e-214], t$95$1, If[LessEqual[x, -6.2e-287], N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 6.3e-53], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - \log y\right) - t\\
t_2 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -10000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.16 \cdot 10^{-214}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-287}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\
\mathbf{elif}\;x \leq 6.3 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -1e10 or 6.29999999999999979e-53 < x Initial program 95.7%
Taylor expanded in y around 0 99.8%
Taylor expanded in x around inf 93.2%
*-commutative93.2%
Simplified93.2%
if -1e10 < x < -1.16e-214 or -6.2000000000000001e-287 < x < 6.29999999999999979e-53Initial program 90.4%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around 0 98.7%
mul-1-neg98.7%
Simplified98.7%
Taylor expanded in y around 0 97.6%
associate-*r*97.6%
neg-mul-197.6%
sub-neg97.6%
metadata-eval97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in z around 0 87.6%
if -1.16e-214 < x < -6.2000000000000001e-287Initial program 70.9%
Taylor expanded in y around 0 100.0%
Taylor expanded in z around inf 79.4%
Final simplification89.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (- (log y)) t)) (t_2 (- (* x (log y)) t)))
(if (<= x -10000000000.0)
t_2
(if (<= x -6.4e-215)
t_1
(if (<= x -3.9e-286)
(- (* y (* z (+ -1.0 (* y -0.5)))) t)
(if (<= x 5.4e-30) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = -log(y) - t;
double t_2 = (x * log(y)) - t;
double tmp;
if (x <= -10000000000.0) {
tmp = t_2;
} else if (x <= -6.4e-215) {
tmp = t_1;
} else if (x <= -3.9e-286) {
tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
} else if (x <= 5.4e-30) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -log(y) - t
t_2 = (x * log(y)) - t
if (x <= (-10000000000.0d0)) then
tmp = t_2
else if (x <= (-6.4d-215)) then
tmp = t_1
else if (x <= (-3.9d-286)) then
tmp = (y * (z * ((-1.0d0) + (y * (-0.5d0))))) - t
else if (x <= 5.4d-30) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -Math.log(y) - t;
double t_2 = (x * Math.log(y)) - t;
double tmp;
if (x <= -10000000000.0) {
tmp = t_2;
} else if (x <= -6.4e-215) {
tmp = t_1;
} else if (x <= -3.9e-286) {
tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
} else if (x <= 5.4e-30) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = -math.log(y) - t t_2 = (x * math.log(y)) - t tmp = 0 if x <= -10000000000.0: tmp = t_2 elif x <= -6.4e-215: tmp = t_1 elif x <= -3.9e-286: tmp = (y * (z * (-1.0 + (y * -0.5)))) - t elif x <= 5.4e-30: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-log(y)) - t) t_2 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -10000000000.0) tmp = t_2; elseif (x <= -6.4e-215) tmp = t_1; elseif (x <= -3.9e-286) tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - t); elseif (x <= 5.4e-30) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -log(y) - t; t_2 = (x * log(y)) - t; tmp = 0.0; if (x <= -10000000000.0) tmp = t_2; elseif (x <= -6.4e-215) tmp = t_1; elseif (x <= -3.9e-286) tmp = (y * (z * (-1.0 + (y * -0.5)))) - t; elseif (x <= 5.4e-30) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -10000000000.0], t$95$2, If[LessEqual[x, -6.4e-215], t$95$1, If[LessEqual[x, -3.9e-286], N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 5.4e-30], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\log y\right) - t\\
t_2 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -10000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6.4 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.9 \cdot 10^{-286}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -1e10 or 5.39999999999999975e-30 < x Initial program 96.5%
Taylor expanded in y around 0 99.8%
Taylor expanded in x around inf 94.7%
*-commutative94.7%
Simplified94.7%
if -1e10 < x < -6.4000000000000003e-215 or -3.89999999999999995e-286 < x < 5.39999999999999975e-30Initial program 89.7%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around 0 98.8%
mul-1-neg98.8%
Simplified98.8%
Taylor expanded in y around 0 86.7%
neg-mul-186.7%
Simplified86.7%
if -6.4000000000000003e-215 < x < -3.89999999999999995e-286Initial program 70.9%
Taylor expanded in y around 0 100.0%
Taylor expanded in z around inf 79.4%
Final simplification90.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -5e+14) (not (<= (+ -1.0 x) -1.0))) (- (- (* x (log y)) (* z y)) t) (- (- (* y (- 1.0 z)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -5e+14) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * log(y)) - (z * y)) - t;
} else {
tmp = ((y * (1.0 - z)) - 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) <= (-5d+14)) .or. (.not. (((-1.0d0) + x) <= (-1.0d0)))) then
tmp = ((x * log(y)) - (z * y)) - t
else
tmp = ((y * (1.0d0 - z)) - 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) <= -5e+14) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * Math.log(y)) - (z * y)) - t;
} else {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -5e+14) or not ((-1.0 + x) <= -1.0): tmp = ((x * math.log(y)) - (z * y)) - t else: tmp = ((y * (1.0 - z)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -5e+14) || !(Float64(-1.0 + x) <= -1.0)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(z * y)) - t); else tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -5e+14) || ~(((-1.0 + x) <= -1.0))) tmp = ((x * log(y)) - (z * y)) - t; else tmp = ((y * (1.0 - z)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -5e+14], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -5 \cdot 10^{+14} \lor \neg \left(-1 + x \leq -1\right):\\
\;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -5e14 or -1 < (-.f64 x #s(literal 1 binary64)) Initial program 97.1%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
mul-1-neg99.7%
fma-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 99.3%
*-commutative99.3%
Simplified99.3%
if -5e14 < (-.f64 x #s(literal 1 binary64)) < -1Initial program 86.7%
Taylor expanded in y around 0 98.6%
+-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
fma-define98.6%
mul-1-neg98.6%
fma-neg98.6%
+-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in x around 0 97.2%
neg-mul-197.2%
cancel-sign-sub-inv97.2%
sub-neg97.2%
metadata-eval97.2%
+-commutative97.2%
*-commutative97.2%
+-commutative97.2%
sub-neg97.2%
*-commutative97.2%
distribute-lft-neg-in97.2%
distribute-rgt-neg-in97.2%
distribute-neg-in97.2%
metadata-eval97.2%
sub-neg97.2%
Simplified97.2%
Final simplification98.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -10000000000.0) (not (<= (+ -1.0 x) -1.0))) (- (* (log y) (+ -1.0 x)) t) (- (- (* y (- 1.0 z)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -10000000000.0) || !((-1.0 + x) <= -1.0)) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = ((y * (1.0 - z)) - 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) <= (-10000000000.0d0)) .or. (.not. (((-1.0d0) + x) <= (-1.0d0)))) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = ((y * (1.0d0 - z)) - 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) <= -10000000000.0) || !((-1.0 + x) <= -1.0)) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -10000000000.0) or not ((-1.0 + x) <= -1.0): tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = ((y * (1.0 - z)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -10000000000.0) || !(Float64(-1.0 + x) <= -1.0)) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -10000000000.0) || ~(((-1.0 + x) <= -1.0))) tmp = (log(y) * (-1.0 + x)) - t; else tmp = ((y * (1.0 - z)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -10000000000.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -10000000000 \lor \neg \left(-1 + x \leq -1\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -1e10 or -1 < (-.f64 x #s(literal 1 binary64)) Initial program 97.1%
+-commutative97.1%
fma-define97.1%
sub-neg97.1%
metadata-eval97.1%
sub-neg97.1%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 96.9%
if -1e10 < (-.f64 x #s(literal 1 binary64)) < -1Initial program 86.6%
Taylor expanded in y around 0 98.6%
+-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
fma-define98.6%
mul-1-neg98.6%
fma-neg98.6%
+-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in x around 0 97.9%
neg-mul-197.9%
cancel-sign-sub-inv97.9%
sub-neg97.9%
metadata-eval97.9%
+-commutative97.9%
*-commutative97.9%
+-commutative97.9%
sub-neg97.9%
*-commutative97.9%
distribute-lft-neg-in97.9%
distribute-rgt-neg-in97.9%
distribute-neg-in97.9%
metadata-eval97.9%
sub-neg97.9%
Simplified97.9%
Final simplification97.4%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (+ z -1.0) (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5)))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5)))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * N[(N[(y * -0.3333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 91.4%
Taylor expanded in y around 0 99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* y (+ (* -0.5 (* y (+ z -1.0))) (- 1.0 z)))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + (y * ((-0.5 * (y * (z + -1.0))) + (1.0 - z)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) + (y * (((-0.5d0) * (y * (z + (-1.0d0)))) + (1.0d0 - z)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + (y * ((-0.5 * (y * (z + -1.0))) + (1.0 - z)))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + (y * ((-0.5 * (y * (z + -1.0))) + (1.0 - z)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(y * Float64(Float64(-0.5 * Float64(y * Float64(z + -1.0))) + Float64(1.0 - z)))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + (y * ((-0.5 * (y * (z + -1.0))) + (1.0 - z)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(-0.5 * N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + y \cdot \left(-0.5 \cdot \left(y \cdot \left(z + -1\right)\right) + \left(1 - z\right)\right)\right) - t
\end{array}
Initial program 91.4%
Taylor expanded in y around 0 99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (+ z -1.0) (* y (+ -1.0 (* y -0.5))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * (-0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * -0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot -0.5\right)\right)\right) - t
\end{array}
Initial program 91.4%
Taylor expanded in y around 0 99.4%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -2e+194)
(- (* y (- (* -0.5 (* z y)) z)) t)
(if (<= z 2.2e+92)
(- (- (log y)) t)
(- (* y (* z (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5))))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+194) {
tmp = (y * ((-0.5 * (z * y)) - z)) - t;
} else if (z <= 2.2e+92) {
tmp = -log(y) - t;
} else {
tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - 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 <= (-2d+194)) then
tmp = (y * (((-0.5d0) * (z * y)) - z)) - t
else if (z <= 2.2d+92) then
tmp = -log(y) - t
else
tmp = (y * (z * ((-1.0d0) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0))))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+194) {
tmp = (y * ((-0.5 * (z * y)) - z)) - t;
} else if (z <= 2.2e+92) {
tmp = -Math.log(y) - t;
} else {
tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2e+194: tmp = (y * ((-0.5 * (z * y)) - z)) - t elif z <= 2.2e+92: tmp = -math.log(y) - t else: tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2e+194) tmp = Float64(Float64(y * Float64(Float64(-0.5 * Float64(z * y)) - z)) - t); elseif (z <= 2.2e+92) tmp = Float64(Float64(-log(y)) - t); else tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5))))) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2e+194) tmp = (y * ((-0.5 * (z * y)) - z)) - t; elseif (z <= 2.2e+92) tmp = -log(y) - t; else tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2e+194], N[(N[(y * N[(N[(-0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[z, 2.2e+92], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], N[(N[(y * N[(z * N[(-1.0 + N[(y * N[(N[(y * -0.3333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+194}:\\
\;\;\;\;y \cdot \left(-0.5 \cdot \left(z \cdot y\right) - z\right) - t\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+92}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right) - t\\
\end{array}
\end{array}
if z < -1.99999999999999989e194Initial program 65.7%
Taylor expanded in y around 0 99.7%
Taylor expanded in z around inf 56.7%
Taylor expanded in y around inf 23.1%
+-commutative23.1%
mul-1-neg23.1%
unsub-neg23.1%
Simplified23.1%
Taylor expanded in y around 0 56.8%
+-commutative56.8%
mul-1-neg56.8%
sub-neg56.8%
*-commutative56.8%
Simplified56.8%
if -1.99999999999999989e194 < z < 2.19999999999999992e92Initial program 99.1%
Taylor expanded in y around 0 99.7%
Taylor expanded in x around 0 63.3%
mul-1-neg63.3%
Simplified63.3%
Taylor expanded in y around 0 61.9%
neg-mul-161.9%
Simplified61.9%
if 2.19999999999999992e92 < z Initial program 77.5%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around inf 56.4%
Final simplification60.3%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 91.4%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
fma-define99.1%
mul-1-neg99.1%
fma-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Final simplification99.1%
(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 91.4%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
fma-define99.1%
mul-1-neg99.1%
fma-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in z around inf 99.0%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (- (* (log y) (+ -1.0 x)) t))
double code(double x, double y, double z, double t) {
return (log(y) * (-1.0 + x)) - 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)) - t
end function
public static double code(double x, double y, double z, double t) {
return (Math.log(y) * (-1.0 + x)) - t;
}
def code(x, y, z, t): return (math.log(y) * (-1.0 + x)) - t
function code(x, y, z, t) return Float64(Float64(log(y) * Float64(-1.0 + x)) - t) end
function tmp = code(x, y, z, t) tmp = (log(y) * (-1.0 + x)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log y \cdot \left(-1 + x\right) - t
\end{array}
Initial program 91.4%
+-commutative91.4%
fma-define91.4%
sub-neg91.4%
metadata-eval91.4%
sub-neg91.4%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 90.2%
Final simplification90.2%
(FPCore (x y z t) :precision binary64 (- (* y (* z (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5))))) t))
double code(double x, double y, double z, double t) {
return (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * (z * ((-1.0d0) + (y * ((y * (-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 * -0.3333333333333333) - 0.5))))) - t;
}
def code(x, y, z, t): return (y * (z * (-1.0 + (y * ((y * -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 * -0.3333333333333333) - 0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = (y * (z * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(z * N[(-1.0 + N[(y * N[(N[(y * -0.3333333333333333), $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 -0.3333333333333333 - 0.5\right)\right)\right) - t
\end{array}
Initial program 91.4%
Taylor expanded in y around 0 99.7%
Taylor expanded in y around 0 99.6%
Taylor expanded in z around inf 47.8%
Final simplification47.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.5e-73) (not (<= t 8.0))) (- 3.0 t) (* y (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.5e-73) || !(t <= 8.0)) {
tmp = 3.0 - t;
} else {
tmp = y * -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 <= (-5.5d-73)) .or. (.not. (t <= 8.0d0))) then
tmp = 3.0d0 - t
else
tmp = y * -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.5e-73) || !(t <= 8.0)) {
tmp = 3.0 - t;
} else {
tmp = y * -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.5e-73) or not (t <= 8.0): tmp = 3.0 - t else: tmp = y * -z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.5e-73) || !(t <= 8.0)) tmp = Float64(3.0 - t); else tmp = Float64(y * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -5.5e-73) || ~((t <= 8.0))) tmp = 3.0 - t; else tmp = y * -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.5e-73], N[Not[LessEqual[t, 8.0]], $MachinePrecision]], N[(3.0 - t), $MachinePrecision], N[(y * (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-73} \lor \neg \left(t \leq 8\right):\\
\;\;\;\;3 - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\end{array}
\end{array}
if t < -5.50000000000000006e-73 or 8 < t Initial program 97.5%
Taylor expanded in z around 0 97.0%
+-commutative97.0%
sub-neg97.0%
metadata-eval97.0%
fma-define97.0%
mul-1-neg97.0%
fma-neg97.0%
+-commutative97.0%
sub-neg97.0%
log1p-define97.0%
Simplified97.0%
Applied egg-rr64.1%
if -5.50000000000000006e-73 < t < 8Initial program 82.6%
Taylor expanded in y around 0 99.4%
Taylor expanded in z around inf 20.4%
Taylor expanded in y around 0 20.0%
associate-*r*20.0%
neg-mul-120.0%
Simplified20.0%
Taylor expanded in y around inf 19.9%
neg-mul-119.9%
distribute-rgt-neg-in19.9%
Simplified19.9%
Final simplification46.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 91.4%
Taylor expanded in y around 0 99.4%
Taylor expanded in z around inf 47.7%
Taylor expanded in y around inf 34.7%
+-commutative34.7%
mul-1-neg34.7%
unsub-neg34.7%
Simplified34.7%
Taylor expanded in y around 0 47.7%
+-commutative47.7%
mul-1-neg47.7%
sub-neg47.7%
*-commutative47.7%
Simplified47.7%
Final simplification47.7%
(FPCore (x y z t) :precision binary64 (- (* y (* z (+ -1.0 (* y -0.5)))) t))
double code(double x, double y, double z, double t) {
return (y * (z * (-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 = (y * (z * ((-1.0d0) + (y * (-0.5d0))))) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * (z * (-1.0 + (y * -0.5)))) - t;
}
def code(x, y, z, t): return (y * (z * (-1.0 + (y * -0.5)))) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - t) end
function tmp = code(x, y, z, t) tmp = (y * (z * (-1.0 + (y * -0.5)))) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t
\end{array}
Initial program 91.4%
Taylor expanded in y around 0 99.4%
Taylor expanded in z around inf 47.7%
Final simplification47.7%
(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 91.4%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
fma-define99.1%
mul-1-neg99.1%
fma-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in y around inf 47.6%
(FPCore (x y z t) :precision binary64 (- (* y (- z)) t))
double code(double x, double y, double z, double t) {
return (y * -z) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * -z) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * -z) - t;
}
def code(x, y, z, t): return (y * -z) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(-z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * -z) - t; end
code[x_, y_, z_, t_] := N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-z\right) - t
\end{array}
Initial program 91.4%
Taylor expanded in y around 0 99.4%
Taylor expanded in z around inf 47.7%
Taylor expanded in y around 0 47.4%
associate-*r*47.4%
neg-mul-147.4%
Simplified47.4%
Final simplification47.4%
(FPCore (x y z t) :precision binary64 (- 3.0 t))
double code(double x, double y, double z, double t) {
return 3.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 = 3.0d0 - t
end function
public static double code(double x, double y, double z, double t) {
return 3.0 - t;
}
def code(x, y, z, t): return 3.0 - t
function code(x, y, z, t) return Float64(3.0 - t) end
function tmp = code(x, y, z, t) tmp = 3.0 - t; end
code[x_, y_, z_, t_] := N[(3.0 - t), $MachinePrecision]
\begin{array}{l}
\\
3 - t
\end{array}
Initial program 91.4%
Taylor expanded in z around 0 90.7%
+-commutative90.7%
sub-neg90.7%
metadata-eval90.7%
fma-define90.7%
mul-1-neg90.7%
fma-neg90.7%
+-commutative90.7%
sub-neg90.7%
log1p-define90.7%
Simplified90.7%
Applied egg-rr41.1%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t
end function
public static double code(double x, double y, double z, double t) {
return -t;
}
def code(x, y, z, t): return -t
function code(x, y, z, t) return Float64(-t) end
function tmp = code(x, y, z, t) tmp = -t; end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 91.4%
+-commutative91.4%
fma-define91.4%
sub-neg91.4%
metadata-eval91.4%
sub-neg91.4%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 39.1%
mul-1-neg39.1%
Simplified39.1%
herbie shell --seed 2024105
(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))