
(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 21 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 89.8%
sub-neg89.8%
+-commutative89.8%
associate-+l+89.8%
fma-define89.8%
sub-neg89.8%
metadata-eval89.8%
sub-neg89.8%
log1p-define99.7%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (fma (+ z -1.0) (log1p (- y)) (* (+ -1.0 x) (log y))) t))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), ((-1.0 + x) * log(y))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(Float64(-1.0 + x) * log(y))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \left(-1 + x\right) \cdot \log y\right) - t
\end{array}
Initial program 89.8%
+-commutative89.8%
fma-define89.8%
sub-neg89.8%
metadata-eval89.8%
sub-neg89.8%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (+ -1.0 x) (log y))
(*
y
(+
(- 1.0 z)
(*
y
(+
(* (+ z -1.0) -0.5)
(*
y
(+ (* (+ z -1.0) -0.3333333333333333) (* -0.25 (* y (+ z -1.0))))))))))
t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + (y * ((1.0 - z) + (y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) + (-0.25 * (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 = ((((-1.0d0) + x) * log(y)) + (y * ((1.0d0 - z) + (y * (((z + (-1.0d0)) * (-0.5d0)) + (y * (((z + (-1.0d0)) * (-0.3333333333333333d0)) + ((-0.25d0) * (y * (z + (-1.0d0))))))))))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + (y * ((1.0 - z) + (y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) + (-0.25 * (y * (z + -1.0)))))))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + (y * ((1.0 - z) + (y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) + (-0.25 * (y * (z + -1.0)))))))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(y * Float64(Float64(1.0 - z) + Float64(y * Float64(Float64(Float64(z + -1.0) * -0.5) + Float64(y * Float64(Float64(Float64(z + -1.0) * -0.3333333333333333) + Float64(-0.25 * Float64(y * Float64(z + -1.0)))))))))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + (y * ((1.0 - z) + (y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) + (-0.25 * (y * (z + -1.0)))))))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(1.0 - z), $MachinePrecision] + N[(y * N[(N[(N[(z + -1.0), $MachinePrecision] * -0.5), $MachinePrecision] + N[(y * N[(N[(N[(z + -1.0), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] + N[(-0.25 * N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + y \cdot \left(\left(1 - z\right) + y \cdot \left(\left(z + -1\right) \cdot -0.5 + y \cdot \left(\left(z + -1\right) \cdot -0.3333333333333333 + -0.25 \cdot \left(y \cdot \left(z + -1\right)\right)\right)\right)\right)\right) - t
\end{array}
Initial program 89.8%
Taylor expanded in y around 0 99.6%
Final simplification99.6%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (+ -1.0 x) (log y))
(*
(+ 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 (((-1.0 + x) * log(y)) + ((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 = ((((-1.0d0) + x) * log(y)) + ((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 (((-1.0 + x) * Math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((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(Float64(-1.0 + x) * log(y)) + 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 = (((-1.0 + x) * log(y)) + ((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[(-1.0 + x), $MachinePrecision] * N[Log[y], $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(\left(-1 + x\right) \cdot \log y + \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 89.8%
Taylor expanded in y around 0 99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -1.0) (not (<= (+ -1.0 x) 1.0))) (- (* (+ -1.0 x) (log 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) <= -1.0) || !((-1.0 + x) <= 1.0)) {
tmp = ((-1.0 + x) * log(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) <= (-1.0d0)) .or. (.not. (((-1.0d0) + x) <= 1.0d0))) then
tmp = (((-1.0d0) + x) * log(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) <= -1.0) || !((-1.0 + x) <= 1.0)) {
tmp = ((-1.0 + x) * Math.log(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) <= -1.0) or not ((-1.0 + x) <= 1.0): tmp = ((-1.0 + x) * math.log(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) <= -1.0) || !(Float64(-1.0 + x) <= 1.0)) tmp = Float64(Float64(Float64(-1.0 + x) * log(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) <= -1.0) || ~(((-1.0 + x) <= 1.0))) tmp = ((-1.0 + x) * log(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], -1.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], 1.0]], $MachinePrecision]], N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[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 -1 \lor \neg \left(-1 + x \leq 1\right):\\
\;\;\;\;\left(-1 + x\right) \cdot \log y - 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)) < -1 or 1 < (-.f64 x #s(literal 1 binary64)) Initial program 90.0%
+-commutative90.0%
fma-define90.0%
sub-neg90.0%
metadata-eval90.0%
sub-neg90.0%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 88.3%
if -1 < (-.f64 x #s(literal 1 binary64)) < 1Initial program 69.9%
Taylor expanded in y around 0 99.5%
Taylor expanded in x around 0 73.6%
mul-1-neg73.6%
Simplified73.6%
Taylor expanded in y around 0 73.6%
sub-neg73.6%
metadata-eval73.6%
+-commutative73.6%
neg-mul-173.6%
distribute-rgt-neg-in73.6%
neg-sub073.6%
associate--r+73.6%
metadata-eval73.6%
Simplified73.6%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* (+ z -1.0) (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5)))))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + ((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 = ((((-1.0d0) + x) * log(y)) + ((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 (((-1.0 + x) * Math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + 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 = (((-1.0 + x) * log(y)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $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(\left(-1 + x\right) \cdot \log y + \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 89.8%
Taylor expanded in y around 0 99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* y (+ (- 1.0 z) (* -0.5 (* y (+ z -1.0)))))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + (y * ((1.0 - z) + (-0.5 * (y * (z + -1.0)))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((((-1.0d0) + x) * log(y)) + (y * ((1.0d0 - z) + ((-0.5d0) * (y * (z + (-1.0d0))))))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + (y * ((1.0 - z) + (-0.5 * (y * (z + -1.0)))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + (y * ((1.0 - z) + (-0.5 * (y * (z + -1.0)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(y * Float64(Float64(1.0 - z) + Float64(-0.5 * Float64(y * Float64(z + -1.0)))))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + (y * ((1.0 - z) + (-0.5 * (y * (z + -1.0)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(1.0 - z), $MachinePrecision] + N[(-0.5 * N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + y \cdot \left(\left(1 - z\right) + -0.5 \cdot \left(y \cdot \left(z + -1\right)\right)\right)\right) - t
\end{array}
Initial program 89.8%
Taylor expanded in y around 0 99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* (+ z -1.0) (* y (+ -1.0 (* y -0.5))))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + ((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 = ((((-1.0d0) + x) * log(y)) + ((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 (((-1.0 + x) * Math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * -0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $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(\left(-1 + x\right) \cdot \log y + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot -0.5\right)\right)\right) - t
\end{array}
Initial program 89.8%
Taylor expanded in y around 0 99.2%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -1.04e+142) (not (<= z 1.25e+49)))
(-
(* y (* z (+ -1.0 (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5)))))
t)
(- (log (/ 1.0 y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.04e+142) || !(z <= 1.25e+49)) {
tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t;
} else {
tmp = log((1.0 / 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.04d+142)) .or. (.not. (z <= 1.25d+49))) then
tmp = (y * (z * ((-1.0d0) + (y * ((y * ((y * (-0.25d0)) - 0.3333333333333333d0)) - 0.5d0))))) - t
else
tmp = log((1.0d0 / 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.04e+142) || !(z <= 1.25e+49)) {
tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t;
} else {
tmp = Math.log((1.0 / y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.04e+142) or not (z <= 1.25e+49): tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t else: tmp = math.log((1.0 / y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.04e+142) || !(z <= 1.25e+49)) tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(Float64(y * Float64(Float64(y * -0.25) - 0.3333333333333333)) - 0.5))))) - t); else tmp = Float64(log(Float64(1.0 / y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.04e+142) || ~((z <= 1.25e+49))) tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t; else tmp = log((1.0 / y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.04e+142], N[Not[LessEqual[z, 1.25e+49]], $MachinePrecision]], N[(N[(y * N[(z * N[(-1.0 + N[(y * N[(N[(y * N[(N[(y * -0.25), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.04 \cdot 10^{+142} \lor \neg \left(z \leq 1.25 \cdot 10^{+49}\right):\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{1}{y}\right) - t\\
\end{array}
\end{array}
if z < -1.04e142 or 1.2500000000000001e49 < z Initial program 69.6%
Taylor expanded in y around 0 99.3%
Taylor expanded in z around inf 62.4%
if -1.04e142 < z < 1.2500000000000001e49Initial program 98.7%
add-log-exp48.3%
exp-sum48.2%
*-commutative48.2%
exp-to-pow48.3%
sub-neg48.3%
metadata-eval48.3%
sub-neg48.3%
metadata-eval48.3%
*-commutative48.3%
exp-to-pow48.3%
sub-neg48.3%
add-sqr-sqrt0.0%
sqrt-unprod47.8%
sqr-neg47.8%
sqrt-unprod47.8%
add-sqr-sqrt47.8%
Applied egg-rr47.8%
Taylor expanded in y around 0 48.4%
Taylor expanded in x around 0 60.2%
Final simplification60.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.0) (not (<= x 1.0))) (- (* x (log y)) t) (- (log (/ 1.0 y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.0) || !(x <= 1.0)) {
tmp = (x * log(y)) - t;
} else {
tmp = log((1.0 / 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 ((x <= (-1.0d0)) .or. (.not. (x <= 1.0d0))) then
tmp = (x * log(y)) - t
else
tmp = log((1.0d0 / y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.0) || !(x <= 1.0)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = Math.log((1.0 / y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.0) or not (x <= 1.0): tmp = (x * math.log(y)) - t else: tmp = math.log((1.0 / y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.0) || !(x <= 1.0)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(log(Float64(1.0 / y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.0) || ~((x <= 1.0))) tmp = (x * log(y)) - t; else tmp = log((1.0 / y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 1.0]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 1\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{1}{y}\right) - t\\
\end{array}
\end{array}
if x < -1 or 1 < x Initial program 95.2%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around inf 94.1%
*-commutative94.1%
Simplified94.1%
if -1 < x < 1Initial program 84.2%
add-log-exp80.6%
exp-sum80.6%
*-commutative80.6%
exp-to-pow80.7%
sub-neg80.7%
metadata-eval80.7%
sub-neg80.7%
metadata-eval80.7%
*-commutative80.7%
exp-to-pow80.7%
sub-neg80.7%
add-sqr-sqrt0.0%
sqrt-unprod79.8%
sqr-neg79.8%
sqrt-unprod79.8%
add-sqr-sqrt79.8%
Applied egg-rr79.8%
Taylor expanded in y around 0 81.4%
Taylor expanded in x around 0 80.1%
Final simplification87.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.0) (not (<= x 1.0))) (- (* x (log y)) t) (- (- y (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.0) || !(x <= 1.0)) {
tmp = (x * log(y)) - t;
} else {
tmp = (y - 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 ((x <= (-1.0d0)) .or. (.not. (x <= 1.0d0))) then
tmp = (x * log(y)) - t
else
tmp = (y - log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.0) || !(x <= 1.0)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = (y - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.0) or not (x <= 1.0): tmp = (x * math.log(y)) - t else: tmp = (y - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.0) || !(x <= 1.0)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(y - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.0) || ~((x <= 1.0))) tmp = (x * log(y)) - t; else tmp = (y - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 1.0]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 1\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\end{array}
\end{array}
if x < -1 or 1 < x Initial program 95.2%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around inf 94.1%
*-commutative94.1%
Simplified94.1%
if -1 < x < 1Initial program 84.2%
Taylor expanded in y around 0 99.0%
Taylor expanded in x around 0 97.7%
mul-1-neg97.7%
Simplified97.7%
Taylor expanded in z around 0 80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in y around 0 80.4%
Final simplification87.4%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + (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 = ((((-1.0d0) + x) * log(y)) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 89.8%
Taylor expanded in y around 0 98.7%
+-commutative98.7%
sub-neg98.7%
metadata-eval98.7%
fma-define98.7%
mul-1-neg98.7%
fma-neg98.7%
+-commutative98.7%
sub-neg98.7%
metadata-eval98.7%
+-commutative98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (<= z 4.2e+224) (- (* (+ -1.0 x) (log y)) t) (- (* z (log1p (- y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.2e+224) {
tmp = ((-1.0 + x) * log(y)) - t;
} else {
tmp = (z * log1p(-y)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.2e+224) {
tmp = ((-1.0 + x) * Math.log(y)) - t;
} else {
tmp = (z * Math.log1p(-y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 4.2e+224: tmp = ((-1.0 + x) * math.log(y)) - t else: tmp = (z * math.log1p(-y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 4.2e+224) tmp = Float64(Float64(Float64(-1.0 + x) * log(y)) - t); else tmp = Float64(Float64(z * log1p(Float64(-y))) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, 4.2e+224], N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.2 \cdot 10^{+224}:\\
\;\;\;\;\left(-1 + x\right) \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\end{array}
\end{array}
if z < 4.2000000000000003e224Initial program 92.4%
+-commutative92.4%
fma-define92.4%
sub-neg92.4%
metadata-eval92.4%
sub-neg92.4%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 91.3%
if 4.2000000000000003e224 < z Initial program 53.8%
Taylor expanded in z around inf 35.5%
*-commutative35.5%
sub-neg35.5%
log1p-define77.1%
Simplified77.1%
Final simplification90.4%
(FPCore (x y z t) :precision binary64 (- (* y (* z (+ -1.0 (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5))))) t))
double code(double x, double y, double z, double t) {
return (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * (z * ((-1.0d0) + (y * ((y * ((y * (-0.25d0)) - 0.3333333333333333d0)) - 0.5d0))))) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t;
}
def code(x, y, z, t): return (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(Float64(y * Float64(Float64(y * -0.25) - 0.3333333333333333)) - 0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(z * N[(-1.0 + N[(y * N[(N[(y * N[(N[(y * -0.25), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(z \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right) - t
\end{array}
Initial program 89.8%
Taylor expanded in y around 0 99.6%
Taylor expanded in z around inf 46.2%
Final simplification46.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 89.8%
Taylor expanded in y around 0 99.6%
Taylor expanded in z around inf 46.2%
Taylor expanded in y around 0 46.1%
*-commutative46.1%
Simplified46.1%
Final simplification46.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.5e+45) (not (<= t 13500000.0))) (- t) (* z (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.5e+45) || !(t <= 13500000.0)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-3.5d+45)) .or. (.not. (t <= 13500000.0d0))) then
tmp = -t
else
tmp = z * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.5e+45) || !(t <= 13500000.0)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.5e+45) or not (t <= 13500000.0): tmp = -t else: tmp = z * -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.5e+45) || !(t <= 13500000.0)) tmp = Float64(-t); else tmp = Float64(z * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.5e+45) || ~((t <= 13500000.0))) tmp = -t; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.5e+45], N[Not[LessEqual[t, 13500000.0]], $MachinePrecision]], (-t), N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+45} \lor \neg \left(t \leq 13500000\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < -3.50000000000000023e45 or 1.35e7 < t Initial program 96.0%
+-commutative96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
sub-neg96.0%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 73.8%
mul-1-neg73.8%
Simplified73.8%
if -3.50000000000000023e45 < t < 1.35e7Initial program 84.7%
Taylor expanded in y around 0 98.1%
+-commutative98.1%
sub-neg98.1%
metadata-eval98.1%
fma-define98.1%
mul-1-neg98.1%
fma-neg98.1%
+-commutative98.1%
sub-neg98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in z around inf 18.4%
mul-1-neg18.4%
distribute-rgt-neg-in18.4%
Simplified18.4%
Taylor expanded in y around inf 17.6%
associate-*r*17.6%
mul-1-neg17.6%
Simplified17.6%
Final simplification43.1%
(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 89.8%
Taylor expanded in y around 0 99.6%
Taylor expanded in z around inf 46.2%
Taylor expanded in y around 0 45.9%
*-commutative45.9%
Simplified45.9%
Final simplification45.9%
(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 89.8%
Taylor expanded in y around 0 99.6%
Taylor expanded in z around inf 46.2%
Taylor expanded in y around 0 45.9%
Final simplification45.9%
(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 89.8%
Taylor expanded in y around 0 98.7%
+-commutative98.7%
sub-neg98.7%
metadata-eval98.7%
fma-define98.7%
mul-1-neg98.7%
fma-neg98.7%
+-commutative98.7%
sub-neg98.7%
metadata-eval98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in y around inf 45.7%
Final simplification45.7%
(FPCore (x y z t) :precision binary64 (- (- t) (* z y)))
double code(double x, double y, double z, double t) {
return -t - (z * y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t - (z * y)
end function
public static double code(double x, double y, double z, double t) {
return -t - (z * y);
}
def code(x, y, z, t): return -t - (z * y)
function code(x, y, z, t) return Float64(Float64(-t) - Float64(z * y)) end
function tmp = code(x, y, z, t) tmp = -t - (z * y); end
code[x_, y_, z_, t_] := N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-t\right) - z \cdot y
\end{array}
Initial program 89.8%
Taylor expanded in y around 0 98.7%
+-commutative98.7%
sub-neg98.7%
metadata-eval98.7%
fma-define98.7%
mul-1-neg98.7%
fma-neg98.7%
+-commutative98.7%
sub-neg98.7%
metadata-eval98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in z around inf 45.4%
mul-1-neg45.4%
distribute-rgt-neg-in45.4%
Simplified45.4%
Final simplification45.4%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t
end function
public static double code(double x, double y, double z, double t) {
return -t;
}
def code(x, y, z, t): return -t
function code(x, y, z, t) return Float64(-t) end
function tmp = code(x, y, z, t) tmp = -t; end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 89.8%
+-commutative89.8%
fma-define89.8%
sub-neg89.8%
metadata-eval89.8%
sub-neg89.8%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in t around inf 35.4%
mul-1-neg35.4%
Simplified35.4%
Final simplification35.4%
herbie shell --seed 2024076
(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))