
(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 13 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 (- (+ (* (log1p (- 0.0 y)) (+ z -1.0)) (* (log y) (+ x -1.0))) t))
double code(double x, double y, double z, double t) {
return ((log1p((0.0 - y)) * (z + -1.0)) + (log(y) * (x + -1.0))) - t;
}
public static double code(double x, double y, double z, double t) {
return ((Math.log1p((0.0 - y)) * (z + -1.0)) + (Math.log(y) * (x + -1.0))) - t;
}
def code(x, y, z, t): return ((math.log1p((0.0 - y)) * (z + -1.0)) + (math.log(y) * (x + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log1p(Float64(0.0 - y)) * Float64(z + -1.0)) + Float64(log(y) * Float64(x + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[1 + N[(0.0 - y), $MachinePrecision]], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{log1p}\left(0 - y\right) \cdot \left(z + -1\right) + \log y \cdot \left(x + -1\right)\right) - t
\end{array}
Initial program 85.1%
sub-negN/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
neg-sub0N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (+ (* (* y (+ -1.0 (* y (+ -0.5 (* y -0.3333333333333333))))) (+ z -1.0)) (* (log y) (+ x -1.0))) t))
double code(double x, double y, double z, double t) {
return (((y * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333))))) * (z + -1.0)) + (log(y) * (x + -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 = (((y * ((-1.0d0) + (y * ((-0.5d0) + (y * (-0.3333333333333333d0)))))) * (z + (-1.0d0))) + (log(y) * (x + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((y * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333))))) * (z + -1.0)) + (Math.log(y) * (x + -1.0))) - t;
}
def code(x, y, z, t): return (((y * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333))))) * (z + -1.0)) + (math.log(y) * (x + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(y * Float64(-1.0 + Float64(y * Float64(-0.5 + Float64(y * -0.3333333333333333))))) * Float64(z + -1.0)) + Float64(log(y) * Float64(x + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = (((y * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333))))) * (z + -1.0)) + (log(y) * (x + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(y * N[(-1.0 + N[(y * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(y \cdot \left(-1 + y \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right)\right) \cdot \left(z + -1\right) + \log y \cdot \left(x + -1\right)\right) - t
\end{array}
Initial program 85.1%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -9.5e+215)
(- (* y (* z (+ -1.0 (* y -0.5)))) t)
(if (<= z 4.5e+161)
(- (/ (log y) (/ 1.0 (+ x -1.0))) t)
(- (* (+ -1.0 (* y (+ -0.5 (* y -0.3333333333333333)))) (* y z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.5e+215) {
tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
} else if (z <= 4.5e+161) {
tmp = (log(y) / (1.0 / (x + -1.0))) - t;
} else {
tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * 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 (z <= (-9.5d+215)) then
tmp = (y * (z * ((-1.0d0) + (y * (-0.5d0))))) - t
else if (z <= 4.5d+161) then
tmp = (log(y) / (1.0d0 / (x + (-1.0d0)))) - t
else
tmp = (((-1.0d0) + (y * ((-0.5d0) + (y * (-0.3333333333333333d0))))) * (y * z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.5e+215) {
tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
} else if (z <= 4.5e+161) {
tmp = (Math.log(y) / (1.0 / (x + -1.0))) - t;
} else {
tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9.5e+215: tmp = (y * (z * (-1.0 + (y * -0.5)))) - t elif z <= 4.5e+161: tmp = (math.log(y) / (1.0 / (x + -1.0))) - t else: tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9.5e+215) tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - t); elseif (z <= 4.5e+161) tmp = Float64(Float64(log(y) / Float64(1.0 / Float64(x + -1.0))) - t); else tmp = Float64(Float64(Float64(-1.0 + Float64(y * Float64(-0.5 + Float64(y * -0.3333333333333333)))) * Float64(y * z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -9.5e+215) tmp = (y * (z * (-1.0 + (y * -0.5)))) - t; elseif (z <= 4.5e+161) tmp = (log(y) / (1.0 / (x + -1.0))) - t; else tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9.5e+215], N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[z, 4.5e+161], N[(N[(N[Log[y], $MachinePrecision] / N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(-1.0 + N[(y * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+215}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+161}:\\
\;\;\;\;\frac{\log y}{\frac{1}{x + -1}} - t\\
\mathbf{else}:\\
\;\;\;\;\left(-1 + y \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right) \cdot \left(y \cdot z\right) - t\\
\end{array}
\end{array}
if z < -9.50000000000000036e215Initial program 55.1%
Taylor expanded in y around 0
Simplified99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6474.3%
Simplified74.3%
if -9.50000000000000036e215 < z < 4.49999999999999992e161Initial program 94.9%
Taylor expanded in y around 0
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6494.7%
Simplified94.7%
+-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6494.7%
Applied egg-rr94.7%
if 4.49999999999999992e161 < z Initial program 50.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6498.8%
Simplified98.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6478.1%
Simplified78.1%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ z -1.0) (* y (+ -1.0 (* y -0.5)))) (* (log y) (+ x -1.0))) t))
double code(double x, double y, double z, double t) {
return (((z + -1.0) * (y * (-1.0 + (y * -0.5)))) + (log(y) * (x + -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 = (((z + (-1.0d0)) * (y * ((-1.0d0) + (y * (-0.5d0))))) + (log(y) * (x + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((z + -1.0) * (y * (-1.0 + (y * -0.5)))) + (Math.log(y) * (x + -1.0))) - t;
}
def code(x, y, z, t): return (((z + -1.0) * (y * (-1.0 + (y * -0.5)))) + (math.log(y) * (x + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * -0.5)))) + Float64(log(y) * Float64(x + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = (((z + -1.0) * (y * (-1.0 + (y * -0.5)))) + (log(y) * (x + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot -0.5\right)\right) + \log y \cdot \left(x + -1\right)\right) - t
\end{array}
Initial program 85.1%
Taylor expanded in y around 0
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.5e+216)
(- (* y (* z (+ -1.0 (* y -0.5)))) t)
(if (<= z 6.6e+161)
(- (* (log y) (+ x -1.0)) t)
(- (* (+ -1.0 (* y (+ -0.5 (* y -0.3333333333333333)))) (* y z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e+216) {
tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
} else if (z <= 6.6e+161) {
tmp = (log(y) * (x + -1.0)) - t;
} else {
tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * 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 (z <= (-5.5d+216)) then
tmp = (y * (z * ((-1.0d0) + (y * (-0.5d0))))) - t
else if (z <= 6.6d+161) then
tmp = (log(y) * (x + (-1.0d0))) - t
else
tmp = (((-1.0d0) + (y * ((-0.5d0) + (y * (-0.3333333333333333d0))))) * (y * z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e+216) {
tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
} else if (z <= 6.6e+161) {
tmp = (Math.log(y) * (x + -1.0)) - t;
} else {
tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.5e+216: tmp = (y * (z * (-1.0 + (y * -0.5)))) - t elif z <= 6.6e+161: tmp = (math.log(y) * (x + -1.0)) - t else: tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.5e+216) tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - t); elseif (z <= 6.6e+161) tmp = Float64(Float64(log(y) * Float64(x + -1.0)) - t); else tmp = Float64(Float64(Float64(-1.0 + Float64(y * Float64(-0.5 + Float64(y * -0.3333333333333333)))) * Float64(y * z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.5e+216) tmp = (y * (z * (-1.0 + (y * -0.5)))) - t; elseif (z <= 6.6e+161) tmp = (log(y) * (x + -1.0)) - t; else tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.5e+216], N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[z, 6.6e+161], N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(-1.0 + N[(y * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+216}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+161}:\\
\;\;\;\;\log y \cdot \left(x + -1\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(-1 + y \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right) \cdot \left(y \cdot z\right) - t\\
\end{array}
\end{array}
if z < -5.5e216Initial program 55.1%
Taylor expanded in y around 0
Simplified99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6474.3%
Simplified74.3%
if -5.5e216 < z < 6.59999999999999995e161Initial program 94.9%
Taylor expanded in y around 0
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6494.7%
Simplified94.7%
if 6.59999999999999995e161 < z Initial program 50.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6498.8%
Simplified98.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6478.1%
Simplified78.1%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* x (log y)) t))) (if (<= t -2900000.0) t_1 (if (<= t 280.0) (* (log y) (+ x -1.0)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - t;
double tmp;
if (t <= -2900000.0) {
tmp = t_1;
} else if (t <= 280.0) {
tmp = log(y) * (x + -1.0);
} 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 (t <= (-2900000.0d0)) then
tmp = t_1
else if (t <= 280.0d0) then
tmp = log(y) * (x + (-1.0d0))
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 (t <= -2900000.0) {
tmp = t_1;
} else if (t <= 280.0) {
tmp = Math.log(y) * (x + -1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - t tmp = 0 if t <= -2900000.0: tmp = t_1 elif t <= 280.0: tmp = math.log(y) * (x + -1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (t <= -2900000.0) tmp = t_1; elseif (t <= 280.0) tmp = Float64(log(y) * Float64(x + -1.0)); 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 (t <= -2900000.0) tmp = t_1; elseif (t <= 280.0) tmp = log(y) * (x + -1.0); 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[t, -2900000.0], t$95$1, If[LessEqual[t, 280.0], N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;t \leq -2900000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 280:\\
\;\;\;\;\log y \cdot \left(x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.9e6 or 280 < t Initial program 91.4%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6490.4%
Simplified90.4%
if -2.9e6 < t < 280Initial program 80.6%
Taylor expanded in y around 0
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6479.8%
Simplified79.8%
Taylor expanded in t around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6479.2%
Simplified79.2%
Final simplification83.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* y (* z (+ -1.0 (* y -0.5)))) t))) (if (<= t -6.5e+37) t_1 (if (<= t 9e+23) (* (log y) (+ x -1.0)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y * (z * (-1.0 + (y * -0.5)))) - t;
double tmp;
if (t <= -6.5e+37) {
tmp = t_1;
} else if (t <= 9e+23) {
tmp = log(y) * (x + -1.0);
} 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 = (y * (z * ((-1.0d0) + (y * (-0.5d0))))) - t
if (t <= (-6.5d+37)) then
tmp = t_1
else if (t <= 9d+23) then
tmp = log(y) * (x + (-1.0d0))
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 = (y * (z * (-1.0 + (y * -0.5)))) - t;
double tmp;
if (t <= -6.5e+37) {
tmp = t_1;
} else if (t <= 9e+23) {
tmp = Math.log(y) * (x + -1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * (z * (-1.0 + (y * -0.5)))) - t tmp = 0 if t <= -6.5e+37: tmp = t_1 elif t <= 9e+23: tmp = math.log(y) * (x + -1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - t) tmp = 0.0 if (t <= -6.5e+37) tmp = t_1; elseif (t <= 9e+23) tmp = Float64(log(y) * Float64(x + -1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * (z * (-1.0 + (y * -0.5)))) - t; tmp = 0.0; if (t <= -6.5e+37) tmp = t_1; elseif (t <= 9e+23) tmp = log(y) * (x + -1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t, -6.5e+37], t$95$1, If[LessEqual[t, 9e+23], N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+23}:\\
\;\;\;\;\log y \cdot \left(x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.4999999999999998e37 or 8.99999999999999958e23 < t Initial program 91.0%
Taylor expanded in y around 0
Simplified99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6480.9%
Simplified80.9%
if -6.4999999999999998e37 < t < 8.99999999999999958e23Initial program 81.4%
Taylor expanded in y around 0
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6480.2%
Simplified80.2%
Taylor expanded in t around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6478.2%
Simplified78.2%
Final simplification79.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -3.6e+25)
t_1
(if (<= x 1.2e+73)
(- (* (+ -1.0 (* y (+ -0.5 (* y -0.3333333333333333)))) (* y z)) t)
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -3.6e+25) {
tmp = t_1;
} else if (x <= 1.2e+73) {
tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (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) :: tmp
t_1 = x * log(y)
if (x <= (-3.6d+25)) then
tmp = t_1
else if (x <= 1.2d+73) then
tmp = (((-1.0d0) + (y * ((-0.5d0) + (y * (-0.3333333333333333d0))))) * (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 tmp;
if (x <= -3.6e+25) {
tmp = t_1;
} else if (x <= 1.2e+73) {
tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -3.6e+25: tmp = t_1 elif x <= 1.2e+73: tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -3.6e+25) tmp = t_1; elseif (x <= 1.2e+73) tmp = Float64(Float64(Float64(-1.0 + Float64(y * Float64(-0.5 + Float64(y * -0.3333333333333333)))) * Float64(y * z)) - t); 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 (x <= -3.6e+25) tmp = t_1; elseif (x <= 1.2e+73) tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (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]}, If[LessEqual[x, -3.6e+25], t$95$1, If[LessEqual[x, 1.2e+73], N[(N[(N[(-1.0 + N[(y * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+73}:\\
\;\;\;\;\left(-1 + y \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right) \cdot \left(y \cdot z\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.60000000000000015e25 or 1.20000000000000001e73 < x Initial program 93.3%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6476.6%
Simplified76.6%
if -3.60000000000000015e25 < x < 1.20000000000000001e73Initial program 78.9%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.7%
Simplified99.7%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6461.9%
Simplified61.9%
Final simplification68.3%
(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 85.1%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= t -2.1e-12) (- 0.0 t) (if (<= t 9500000000000.0) (* y (* z (+ -1.0 (* y -0.5)))) (- 0.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.1e-12) {
tmp = 0.0 - t;
} else if (t <= 9500000000000.0) {
tmp = y * (z * (-1.0 + (y * -0.5)));
} else {
tmp = 0.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 (t <= (-2.1d-12)) then
tmp = 0.0d0 - t
else if (t <= 9500000000000.0d0) then
tmp = y * (z * ((-1.0d0) + (y * (-0.5d0))))
else
tmp = 0.0d0 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.1e-12) {
tmp = 0.0 - t;
} else if (t <= 9500000000000.0) {
tmp = y * (z * (-1.0 + (y * -0.5)));
} else {
tmp = 0.0 - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.1e-12: tmp = 0.0 - t elif t <= 9500000000000.0: tmp = y * (z * (-1.0 + (y * -0.5))) else: tmp = 0.0 - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.1e-12) tmp = Float64(0.0 - t); elseif (t <= 9500000000000.0) tmp = Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))); else tmp = Float64(0.0 - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.1e-12) tmp = 0.0 - t; elseif (t <= 9500000000000.0) tmp = y * (z * (-1.0 + (y * -0.5))); else tmp = 0.0 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.1e-12], N[(0.0 - t), $MachinePrecision], If[LessEqual[t, 9500000000000.0], N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-12}:\\
\;\;\;\;0 - t\\
\mathbf{elif}\;t \leq 9500000000000:\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0 - t\\
\end{array}
\end{array}
if t < -2.09999999999999994e-12 or 9.5e12 < t Initial program 92.0%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6465.0%
Simplified65.0%
sub0-negN/A
neg-lowering-neg.f6465.0%
Applied egg-rr65.0%
if -2.09999999999999994e-12 < t < 9.5e12Initial program 79.7%
Taylor expanded in y around 0
Simplified99.2%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6422.8%
Simplified22.8%
Final simplification41.4%
(FPCore (x y z t) :precision binary64 (- (* (+ -1.0 (* y (+ -0.5 (* y -0.3333333333333333)))) (* y z)) t))
double code(double x, double y, double z, double t) {
return ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (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 = (((-1.0d0) + (y * ((-0.5d0) + (y * (-0.3333333333333333d0))))) * (y * z)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t;
}
def code(x, y, z, t): return ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t
function code(x, y, z, t) return Float64(Float64(Float64(-1.0 + Float64(y * Float64(-0.5 + Float64(y * -0.3333333333333333)))) * Float64(y * z)) - t) end
function tmp = code(x, y, z, t) tmp = ((-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))) * (y * z)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(-1.0 + N[(y * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(-1 + y \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right) \cdot \left(y \cdot z\right) - t
\end{array}
Initial program 85.1%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.7%
Simplified99.7%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6445.2%
Simplified45.2%
Final simplification45.2%
(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 85.1%
Taylor expanded in y around 0
Simplified99.5%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6445.0%
Simplified45.0%
Final simplification45.0%
(FPCore (x y z t) :precision binary64 (- 0.0 t))
double code(double x, double y, double z, double t) {
return 0.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 = 0.0d0 - t
end function
public static double code(double x, double y, double z, double t) {
return 0.0 - t;
}
def code(x, y, z, t): return 0.0 - t
function code(x, y, z, t) return Float64(0.0 - t) end
function tmp = code(x, y, z, t) tmp = 0.0 - t; end
code[x_, y_, z_, t_] := N[(0.0 - t), $MachinePrecision]
\begin{array}{l}
\\
0 - t
\end{array}
Initial program 85.1%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6430.2%
Simplified30.2%
sub0-negN/A
neg-lowering-neg.f6430.2%
Applied egg-rr30.2%
Final simplification30.2%
herbie shell --seed 2024152
(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))