
(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 11 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 (- (+ (* (log y) (+ x -1.0)) (* y (+ (* -0.5 (* y (+ -1.0 z))) (- 1.0 z)))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (x + -1.0)) + (y * ((-0.5 * (y * (-1.0 + z))) + (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) * (x + (-1.0d0))) + (y * (((-0.5d0) * (y * ((-1.0d0) + z))) + (1.0d0 - z)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (x + -1.0)) + (y * ((-0.5 * (y * (-1.0 + z))) + (1.0 - z)))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (x + -1.0)) + (y * ((-0.5 * (y * (-1.0 + z))) + (1.0 - z)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(y * Float64(Float64(-0.5 * Float64(y * Float64(-1.0 + z))) + Float64(1.0 - z)))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (x + -1.0)) + (y * ((-0.5 * (y * (-1.0 + z))) + (1.0 - z)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(-0.5 * N[(y * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(x + -1\right) + y \cdot \left(-0.5 \cdot \left(y \cdot \left(-1 + z\right)\right) + \left(1 - z\right)\right)\right) - t
\end{array}
Initial program 92.9%
Taylor expanded in y around 0 99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.1e+91) (not (<= z 5.2e+30))) (- (* z (- (* (log y) (/ (+ x -1.0) z)) y)) t) (- (* (log y) (+ x -1.0)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.1e+91) || !(z <= 5.2e+30)) {
tmp = (z * ((log(y) * ((x + -1.0) / z)) - y)) - t;
} else {
tmp = (log(y) * (x + -1.0)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.1d+91)) .or. (.not. (z <= 5.2d+30))) then
tmp = (z * ((log(y) * ((x + (-1.0d0)) / z)) - y)) - t
else
tmp = (log(y) * (x + (-1.0d0))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.1e+91) || !(z <= 5.2e+30)) {
tmp = (z * ((Math.log(y) * ((x + -1.0) / z)) - y)) - t;
} else {
tmp = (Math.log(y) * (x + -1.0)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.1e+91) or not (z <= 5.2e+30): tmp = (z * ((math.log(y) * ((x + -1.0) / z)) - y)) - t else: tmp = (math.log(y) * (x + -1.0)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.1e+91) || !(z <= 5.2e+30)) tmp = Float64(Float64(z * Float64(Float64(log(y) * Float64(Float64(x + -1.0) / z)) - y)) - t); else tmp = Float64(Float64(log(y) * Float64(x + -1.0)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.1e+91) || ~((z <= 5.2e+30))) tmp = (z * ((log(y) * ((x + -1.0) / z)) - y)) - t; else tmp = (log(y) * (x + -1.0)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.1e+91], N[Not[LessEqual[z, 5.2e+30]], $MachinePrecision]], N[(N[(z * N[(N[(N[Log[y], $MachinePrecision] * N[(N[(x + -1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+91} \lor \neg \left(z \leq 5.2 \cdot 10^{+30}\right):\\
\;\;\;\;z \cdot \left(\log y \cdot \frac{x + -1}{z} - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(x + -1\right) - t\\
\end{array}
\end{array}
if z < -3.09999999999999998e91 or 5.19999999999999977e30 < z Initial program 79.5%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
*-commutative99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 99.5%
Taylor expanded in z around inf 99.5%
mul-1-neg99.5%
associate-/l*99.4%
distribute-lft-neg-in99.4%
log-rec99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
mul-1-neg99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in z around inf 99.4%
if -3.09999999999999998e91 < z < 5.19999999999999977e30Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 99.9%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ x -1.0)) (* (+ -1.0 z) (* y (+ -1.0 (* y -0.5))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (x + -1.0)) + ((-1.0 + z) * (y * (-1.0 + (y * -0.5))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * (x + (-1.0d0))) + (((-1.0d0) + z) * (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) * (x + -1.0)) + ((-1.0 + z) * (y * (-1.0 + (y * -0.5))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (x + -1.0)) + ((-1.0 + z) * (y * (-1.0 + (y * -0.5))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(Float64(-1.0 + z) * Float64(y * Float64(-1.0 + Float64(y * -0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (x + -1.0)) + ((-1.0 + z) * (y * (-1.0 + (y * -0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 + z), $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(x + -1\right) + \left(-1 + z\right) \cdot \left(y \cdot \left(-1 + y \cdot -0.5\right)\right)\right) - t
\end{array}
Initial program 92.9%
Taylor expanded in y around 0 99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4200000.0) (not (<= x 0.072))) (- (* x (log y)) t) (- (* y (- 1.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4200000.0) || !(x <= 0.072)) {
tmp = (x * log(y)) - t;
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-4200000.0d0)) .or. (.not. (x <= 0.072d0))) then
tmp = (x * log(y)) - t
else
tmp = (y * (1.0d0 - z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4200000.0) || !(x <= 0.072)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4200000.0) or not (x <= 0.072): tmp = (x * math.log(y)) - t else: tmp = (y * (1.0 - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4200000.0) || !(x <= 0.072)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(y * Float64(1.0 - z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4200000.0) || ~((x <= 0.072))) tmp = (x * log(y)) - t; else tmp = (y * (1.0 - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4200000.0], N[Not[LessEqual[x, 0.072]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4200000 \lor \neg \left(x \leq 0.072\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if x < -4.2e6 or 0.0719999999999999946 < x Initial program 97.1%
Taylor expanded in y around 0 99.7%
Taylor expanded in x around inf 96.3%
*-commutative96.3%
Simplified96.3%
if -4.2e6 < x < 0.0719999999999999946Initial program 88.7%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
*-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in y around inf 68.0%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (- (- (* (log (/ 1.0 y)) (- 1.0 x)) (* y (+ -1.0 z))) t))
double code(double x, double y, double z, double t) {
return ((log((1.0 / 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((1.0d0 / 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((1.0 / y)) * (1.0 - x)) - (y * (-1.0 + z))) - t;
}
def code(x, y, z, t): return ((math.log((1.0 / y)) * (1.0 - x)) - (y * (-1.0 + z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(Float64(1.0 / y)) * Float64(1.0 - x)) - Float64(y * Float64(-1.0 + z))) - t) end
function tmp = code(x, y, z, t) tmp = ((log((1.0 / y)) * (1.0 - x)) - (y * (-1.0 + z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] - N[(y * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(\frac{1}{y}\right) \cdot \left(1 - x\right) - y \cdot \left(-1 + z\right)\right) - t
\end{array}
Initial program 92.9%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
mul-1-neg99.7%
unsub-neg99.7%
*-commutative99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ x -1.0)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (x + -1.0)) + (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) * (x + (-1.0d0))) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (x + -1.0)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (x + -1.0)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (x + -1.0)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(x + -1\right) + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 92.9%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
mul-1-neg99.7%
unsub-neg99.7%
*-commutative99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (if (<= z 1.12e+278) (- (* (log y) (+ x -1.0)) t) (- (* z (- y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.12e+278) {
tmp = (log(y) * (x + -1.0)) - t;
} else {
tmp = (z * -y) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.12d+278) then
tmp = (log(y) * (x + (-1.0d0))) - t
else
tmp = (z * -y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.12e+278) {
tmp = (Math.log(y) * (x + -1.0)) - t;
} else {
tmp = (z * -y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 1.12e+278: tmp = (math.log(y) * (x + -1.0)) - t else: tmp = (z * -y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 1.12e+278) tmp = Float64(Float64(log(y) * Float64(x + -1.0)) - t); else tmp = Float64(Float64(z * Float64(-y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 1.12e+278) tmp = (log(y) * (x + -1.0)) - t; else tmp = (z * -y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 1.12e+278], N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.12 \cdot 10^{+278}:\\
\;\;\;\;\log y \cdot \left(x + -1\right) - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\end{array}
\end{array}
if z < 1.11999999999999994e278Initial program 94.6%
Taylor expanded in y around 0 99.8%
Taylor expanded in y around 0 94.4%
if 1.11999999999999994e278 < z Initial program 39.5%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
*-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
Simplified100.0%
Final simplification94.5%
(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 92.9%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
mul-1-neg99.7%
unsub-neg99.7%
*-commutative99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 99.7%
Taylor expanded in y around inf 48.1%
(FPCore (x y z t) :precision binary64 (- (* z (- y)) t))
double code(double x, double y, double z, double t) {
return (z * -y) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (z * -y) - t
end function
public static double code(double x, double y, double z, double t) {
return (z * -y) - t;
}
def code(x, y, z, t): return (z * -y) - t
function code(x, y, z, t) return Float64(Float64(z * Float64(-y)) - t) end
function tmp = code(x, y, z, t) tmp = (z * -y) - t; end
code[x_, y_, z_, t_] := N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(-y\right) - t
\end{array}
Initial program 92.9%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
mul-1-neg99.7%
unsub-neg99.7%
*-commutative99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 47.9%
associate-*r*47.9%
neg-mul-147.9%
Simplified47.9%
Final simplification47.9%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t
end function
public static double code(double x, double y, double z, double t) {
return -t;
}
def code(x, y, z, t): return -t
function code(x, y, z, t) return Float64(-t) end
function tmp = code(x, y, z, t) tmp = -t; end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 92.9%
+-commutative92.9%
fma-define92.9%
sub-neg92.9%
metadata-eval92.9%
sub-neg92.9%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 80.1%
Taylor expanded in t around inf 40.8%
neg-mul-140.8%
Simplified40.8%
(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 92.9%
+-commutative92.9%
fma-define92.9%
sub-neg92.9%
metadata-eval92.9%
sub-neg92.9%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 80.1%
Taylor expanded in t around inf 40.8%
neg-mul-140.8%
Simplified40.8%
neg-sub040.8%
sub-neg40.8%
add-sqr-sqrt18.4%
sqrt-unprod10.5%
sqr-neg10.5%
sqrt-unprod1.2%
add-sqr-sqrt2.0%
Applied egg-rr2.0%
+-lft-identity2.0%
Simplified2.0%
herbie shell --seed 2024135
(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))