
(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.3%
sub-neg89.3%
+-commutative89.3%
associate-+l+89.3%
fma-define89.3%
sub-neg89.3%
metadata-eval89.3%
sub-neg89.3%
log1p-define99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (- (fma (+ z -1.0) (log1p (- y)) (* (+ -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.3%
+-commutative89.3%
fma-define89.3%
sub-neg89.3%
metadata-eval89.3%
sub-neg89.3%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (+ -1.0 x) (log y))
(*
(+ z -1.0)
(*
y
(+
-1.0
(*
y
(-
(*
y
(-
(* y (- (* y (- (* y -0.16666666666666666) 0.2)) 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 * ((y * ((y * -0.16666666666666666) - 0.2)) - 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 * ((y * ((y * (-0.16666666666666666d0)) - 0.2d0)) - 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 * ((y * ((y * -0.16666666666666666) - 0.2)) - 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 * ((y * ((y * -0.16666666666666666) - 0.2)) - 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 * Float64(Float64(y * Float64(Float64(y * -0.16666666666666666) - 0.2)) - 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 * ((y * ((y * -0.16666666666666666) - 0.2)) - 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 * N[(N[(y * N[(N[(y * -0.16666666666666666), $MachinePrecision] - 0.2), $MachinePrecision]), $MachinePrecision] - 0.25), $MachinePrecision]), $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 \left(y \cdot \left(y \cdot -0.16666666666666666 - 0.2\right) - 0.25\right) - 0.3333333333333333\right) - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 89.3%
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 (- (* y -0.2) 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 * ((y * -0.2) - 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 * ((y * (-0.2d0)) - 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 * ((y * -0.2) - 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 * ((y * -0.2) - 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 * Float64(Float64(y * -0.2) - 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 * ((y * -0.2) - 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 * N[(N[(y * -0.2), $MachinePrecision] - 0.25), $MachinePrecision]), $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 \left(y \cdot -0.2 - 0.25\right) - 0.3333333333333333\right) - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 89.3%
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.3%
Taylor expanded in y around 0 99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -500.0) (not (<= (+ -1.0 x) -0.99999998))) (- (* (+ -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) <= -500.0) || !((-1.0 + x) <= -0.99999998)) {
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) <= (-500.0d0)) .or. (.not. (((-1.0d0) + x) <= (-0.99999998d0)))) 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) <= -500.0) || !((-1.0 + x) <= -0.99999998)) {
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) <= -500.0) or not ((-1.0 + x) <= -0.99999998): 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) <= -500.0) || !(Float64(-1.0 + x) <= -0.99999998)) 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) <= -500.0) || ~(((-1.0 + x) <= -0.99999998))) 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], -500.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.99999998]], $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 -500 \lor \neg \left(-1 + x \leq -0.99999998\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 1) < -500 or -0.999999980000000011 < (-.f64 x 1) Initial program 93.3%
Taylor expanded in y around 0 99.8%
Taylor expanded in z around 0 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in y around 0 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in y around 0 92.2%
if -500 < (-.f64 x 1) < -0.999999980000000011Initial program 85.0%
Taylor expanded in x around 0 85.0%
mul-1-neg85.0%
Simplified85.0%
Taylor expanded in y around 0 98.8%
mul-1-neg98.8%
distribute-rgt-neg-in98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
distribute-neg-in98.8%
metadata-eval98.8%
sub-neg98.8%
Simplified98.8%
Final simplification95.4%
(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.3%
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 -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.3%
Taylor expanded in y around 0 99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- 1.0 z))))
(if (<= t -175000.0)
(- (- t) (* z y))
(if (<= t 0.04) (- t_1 (log y)) (- t_1 t)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (1.0 - z);
double tmp;
if (t <= -175000.0) {
tmp = -t - (z * y);
} else if (t <= 0.04) {
tmp = t_1 - log(y);
} else {
tmp = t_1 - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (1.0d0 - z)
if (t <= (-175000.0d0)) then
tmp = -t - (z * y)
else if (t <= 0.04d0) then
tmp = t_1 - log(y)
else
tmp = t_1 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (1.0 - z);
double tmp;
if (t <= -175000.0) {
tmp = -t - (z * y);
} else if (t <= 0.04) {
tmp = t_1 - Math.log(y);
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (1.0 - z) tmp = 0 if t <= -175000.0: tmp = -t - (z * y) elif t <= 0.04: tmp = t_1 - math.log(y) else: tmp = t_1 - t return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(1.0 - z)) tmp = 0.0 if (t <= -175000.0) tmp = Float64(Float64(-t) - Float64(z * y)); elseif (t <= 0.04) tmp = Float64(t_1 - log(y)); else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (1.0 - z); tmp = 0.0; if (t <= -175000.0) tmp = -t - (z * y); elseif (t <= 0.04) tmp = t_1 - log(y); else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -175000.0], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.04], N[(t$95$1 - N[Log[y], $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - z\right)\\
\mathbf{if}\;t \leq -175000:\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\mathbf{elif}\;t \leq 0.04:\\
\;\;\;\;t\_1 - \log y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < -175000Initial program 94.0%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
mul-1-neg99.7%
fma-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 78.2%
associate-*r*78.2%
neg-mul-178.2%
Simplified78.2%
if -175000 < t < 0.0400000000000000008Initial program 83.5%
Taylor expanded in x around 0 41.9%
mul-1-neg41.9%
Simplified41.9%
Taylor expanded in y around 0 56.6%
mul-1-neg56.6%
distribute-rgt-neg-in56.6%
sub-neg56.6%
metadata-eval56.6%
+-commutative56.6%
distribute-neg-in56.6%
metadata-eval56.6%
sub-neg56.6%
Simplified56.6%
Taylor expanded in t around 0 56.2%
if 0.0400000000000000008 < t Initial program 94.7%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
fma-define99.4%
mul-1-neg99.4%
fma-neg99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 72.9%
Final simplification66.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.1e+137) (not (<= z 3.9e+166))) (- (- t) (* z y)) (- (- y (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.1e+137) || !(z <= 3.9e+166)) {
tmp = -t - (z * y);
} 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 ((z <= (-2.1d+137)) .or. (.not. (z <= 3.9d+166))) then
tmp = -t - (z * y)
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 ((z <= -2.1e+137) || !(z <= 3.9e+166)) {
tmp = -t - (z * y);
} else {
tmp = (y - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.1e+137) or not (z <= 3.9e+166): tmp = -t - (z * y) else: tmp = (y - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.1e+137) || !(z <= 3.9e+166)) tmp = Float64(Float64(-t) - Float64(z * y)); else tmp = Float64(Float64(y - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.1e+137) || ~((z <= 3.9e+166))) tmp = -t - (z * y); else tmp = (y - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.1e+137], N[Not[LessEqual[z, 3.9e+166]], $MachinePrecision]], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+137} \lor \neg \left(z \leq 3.9 \cdot 10^{+166}\right):\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\end{array}
\end{array}
if z < -2.0999999999999999e137 or 3.89999999999999991e166 < z Initial program 61.1%
Taylor expanded in y around 0 97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
fma-define97.8%
mul-1-neg97.8%
fma-neg97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in z around inf 73.3%
associate-*r*73.3%
neg-mul-173.3%
Simplified73.3%
if -2.0999999999999999e137 < z < 3.89999999999999991e166Initial program 99.1%
Taylor expanded in x around 0 63.9%
mul-1-neg63.9%
Simplified63.9%
Taylor expanded in y around 0 64.2%
mul-1-neg64.2%
distribute-rgt-neg-in64.2%
sub-neg64.2%
metadata-eval64.2%
+-commutative64.2%
distribute-neg-in64.2%
metadata-eval64.2%
sub-neg64.2%
Simplified64.2%
Taylor expanded in z around 0 63.5%
Final simplification66.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.5e+135) (not (<= z 2.8e+166))) (- (- t) (* z y)) (- (- t) (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e+135) || !(z <= 2.8e+166)) {
tmp = -t - (z * y);
} else {
tmp = -t - log(y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-9.5d+135)) .or. (.not. (z <= 2.8d+166))) then
tmp = -t - (z * y)
else
tmp = -t - log(y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e+135) || !(z <= 2.8e+166)) {
tmp = -t - (z * y);
} else {
tmp = -t - Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9.5e+135) or not (z <= 2.8e+166): tmp = -t - (z * y) else: tmp = -t - math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9.5e+135) || !(z <= 2.8e+166)) tmp = Float64(Float64(-t) - Float64(z * y)); else tmp = Float64(Float64(-t) - log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9.5e+135) || ~((z <= 2.8e+166))) tmp = -t - (z * y); else tmp = -t - log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.5e+135], N[Not[LessEqual[z, 2.8e+166]], $MachinePrecision]], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+135} \lor \neg \left(z \leq 2.8 \cdot 10^{+166}\right):\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - \log y\\
\end{array}
\end{array}
if z < -9.50000000000000036e135 or 2.79999999999999996e166 < z Initial program 61.1%
Taylor expanded in y around 0 97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
fma-define97.8%
mul-1-neg97.8%
fma-neg97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in z around inf 73.3%
associate-*r*73.3%
neg-mul-173.3%
Simplified73.3%
if -9.50000000000000036e135 < z < 2.79999999999999996e166Initial program 99.1%
Taylor expanded in x around 0 63.9%
mul-1-neg63.9%
Simplified63.9%
Taylor expanded in y around 0 63.4%
mul-1-neg63.4%
distribute-neg-in63.4%
unsub-neg63.4%
Simplified63.4%
Final simplification65.9%
(FPCore (x y z t) :precision binary64 (if (<= z 2.15e+260) (- (+ y (* (+ -1.0 x) (log y))) t) (- (- t) (* z y))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.15e+260) {
tmp = (y + ((-1.0 + x) * log(y))) - t;
} else {
tmp = -t - (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 (z <= 2.15d+260) then
tmp = (y + (((-1.0d0) + x) * log(y))) - t
else
tmp = -t - (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.15e+260) {
tmp = (y + ((-1.0 + x) * Math.log(y))) - t;
} else {
tmp = -t - (z * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 2.15e+260: tmp = (y + ((-1.0 + x) * math.log(y))) - t else: tmp = -t - (z * y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 2.15e+260) tmp = Float64(Float64(y + Float64(Float64(-1.0 + x) * log(y))) - t); else tmp = Float64(Float64(-t) - Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 2.15e+260) tmp = (y + ((-1.0 + x) * log(y))) - t; else tmp = -t - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 2.15e+260], N[(N[(y + N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.15 \cdot 10^{+260}:\\
\;\;\;\;\left(y + \left(-1 + x\right) \cdot \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\end{array}
\end{array}
if z < 2.15000000000000012e260Initial program 92.1%
Taylor expanded in y around 0 99.6%
Taylor expanded in z around inf 99.5%
Taylor expanded in z around 0 90.8%
if 2.15000000000000012e260 < z Initial program 31.2%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
fma-define100.0%
mul-1-neg100.0%
fma-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 96.4%
associate-*r*96.4%
neg-mul-196.4%
Simplified96.4%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (if (<= t -175000.0) (- (- t) (* z y)) (if (<= t 8.2e-8) (- y (log y)) (- (* y (- 1.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -175000.0) {
tmp = -t - (z * y);
} else if (t <= 8.2e-8) {
tmp = y - log(y);
} 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 (t <= (-175000.0d0)) then
tmp = -t - (z * y)
else if (t <= 8.2d-8) then
tmp = y - log(y)
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 (t <= -175000.0) {
tmp = -t - (z * y);
} else if (t <= 8.2e-8) {
tmp = y - Math.log(y);
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -175000.0: tmp = -t - (z * y) elif t <= 8.2e-8: tmp = y - math.log(y) else: tmp = (y * (1.0 - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -175000.0) tmp = Float64(Float64(-t) - Float64(z * y)); elseif (t <= 8.2e-8) tmp = Float64(y - log(y)); 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 (t <= -175000.0) tmp = -t - (z * y); elseif (t <= 8.2e-8) tmp = y - log(y); else tmp = (y * (1.0 - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -175000.0], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.2e-8], N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -175000:\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{-8}:\\
\;\;\;\;y - \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if t < -175000Initial program 94.0%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
mul-1-neg99.7%
fma-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 78.2%
associate-*r*78.2%
neg-mul-178.2%
Simplified78.2%
if -175000 < t < 8.20000000000000063e-8Initial program 83.5%
Taylor expanded in x around 0 41.9%
mul-1-neg41.9%
Simplified41.9%
Taylor expanded in y around 0 56.6%
mul-1-neg56.6%
distribute-rgt-neg-in56.6%
sub-neg56.6%
metadata-eval56.6%
+-commutative56.6%
distribute-neg-in56.6%
metadata-eval56.6%
sub-neg56.6%
Simplified56.6%
Taylor expanded in z around 0 40.0%
Taylor expanded in t around 0 39.6%
if 8.20000000000000063e-8 < t Initial program 94.7%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
fma-define99.4%
mul-1-neg99.4%
fma-neg99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 72.9%
Final simplification59.0%
(FPCore (x y z t) :precision binary64 (- (- (* (+ -1.0 x) (log y)) (* y (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) - (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 * (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 * (z + -1.0))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) - (y * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) - Float64(y * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) - (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[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y - y \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 89.3%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
fma-define99.0%
mul-1-neg99.0%
fma-neg99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (<= z 3.1e+259) (- (* (+ -1.0 x) (log y)) t) (- (- t) (* z y))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.1e+259) {
tmp = ((-1.0 + x) * log(y)) - t;
} else {
tmp = -t - (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 (z <= 3.1d+259) then
tmp = (((-1.0d0) + x) * log(y)) - t
else
tmp = -t - (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.1e+259) {
tmp = ((-1.0 + x) * Math.log(y)) - t;
} else {
tmp = -t - (z * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 3.1e+259: tmp = ((-1.0 + x) * math.log(y)) - t else: tmp = -t - (z * y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 3.1e+259) tmp = Float64(Float64(Float64(-1.0 + x) * log(y)) - t); else tmp = Float64(Float64(-t) - Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 3.1e+259) tmp = ((-1.0 + x) * log(y)) - t; else tmp = -t - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 3.1e+259], N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.1 \cdot 10^{+259}:\\
\;\;\;\;\left(-1 + x\right) \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\end{array}
\end{array}
if z < 3.1000000000000003e259Initial program 92.1%
Taylor expanded in y around 0 99.6%
Taylor expanded in z around 0 90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in y around 0 90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in y around 0 90.7%
if 3.1000000000000003e259 < z Initial program 31.2%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
fma-define100.0%
mul-1-neg100.0%
fma-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 96.4%
associate-*r*96.4%
neg-mul-196.4%
Simplified96.4%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (- (- (* (+ -1.0 x) (log y)) (* z y)) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) - (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 = ((((-1.0d0) + x) * log(y)) - (z * y)) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) - (z * y)) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) - (z * y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) - Float64(z * y)) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) - (z * y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y - z \cdot y\right) - t
\end{array}
Initial program 89.3%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
fma-define99.0%
mul-1-neg99.0%
fma-neg99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in z around inf 98.9%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.96e-13) (not (<= t 0.035))) (- t) (* z (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.96e-13) || !(t <= 0.035)) {
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 <= (-1.96d-13)) .or. (.not. (t <= 0.035d0))) 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 <= -1.96e-13) || !(t <= 0.035)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.96e-13) or not (t <= 0.035): tmp = -t else: tmp = z * -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.96e-13) || !(t <= 0.035)) 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 <= -1.96e-13) || ~((t <= 0.035))) tmp = -t; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.96e-13], N[Not[LessEqual[t, 0.035]], $MachinePrecision]], (-t), N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.96 \cdot 10^{-13} \lor \neg \left(t \leq 0.035\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < -1.95999999999999998e-13 or 0.035000000000000003 < t Initial program 94.5%
sub-neg94.5%
+-commutative94.5%
associate-+l+94.5%
fma-define94.5%
sub-neg94.5%
metadata-eval94.5%
sub-neg94.5%
log1p-define99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in t around inf 67.9%
neg-mul-167.9%
Simplified67.9%
if -1.95999999999999998e-13 < t < 0.035000000000000003Initial program 82.8%
Taylor expanded in x around 0 41.8%
mul-1-neg41.8%
Simplified41.8%
Taylor expanded in y around 0 57.2%
mul-1-neg57.2%
distribute-rgt-neg-in57.2%
sub-neg57.2%
metadata-eval57.2%
+-commutative57.2%
distribute-neg-in57.2%
metadata-eval57.2%
sub-neg57.2%
Simplified57.2%
Taylor expanded in z around inf 19.9%
associate-*r*19.9%
neg-mul-119.9%
Simplified19.9%
Final simplification46.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 89.3%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
fma-define99.0%
mul-1-neg99.0%
fma-neg99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in y around inf 49.9%
Final simplification49.9%
(FPCore (x y z t) :precision binary64 (- (- t) (* z y)))
double code(double x, double y, double z, double t) {
return -t - (z * y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t - (z * y)
end function
public static double code(double x, double y, double z, double t) {
return -t - (z * y);
}
def code(x, y, z, t): return -t - (z * y)
function code(x, y, z, t) return Float64(Float64(-t) - Float64(z * y)) end
function tmp = code(x, y, z, t) tmp = -t - (z * y); end
code[x_, y_, z_, t_] := N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-t\right) - z \cdot y
\end{array}
Initial program 89.3%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
fma-define99.0%
mul-1-neg99.0%
fma-neg99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in z around inf 49.7%
associate-*r*49.7%
neg-mul-149.7%
Simplified49.7%
Final simplification49.7%
(FPCore (x y z t) :precision binary64 (- y t))
double code(double x, double y, double z, double t) {
return 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 = y - t
end function
public static double code(double x, double y, double z, double t) {
return y - t;
}
def code(x, y, z, t): return y - t
function code(x, y, z, t) return Float64(y - t) end
function tmp = code(x, y, z, t) tmp = y - t; end
code[x_, y_, z_, t_] := N[(y - t), $MachinePrecision]
\begin{array}{l}
\\
y - t
\end{array}
Initial program 89.3%
Taylor expanded in x around 0 57.9%
mul-1-neg57.9%
Simplified57.9%
Taylor expanded in y around 0 67.4%
mul-1-neg67.4%
distribute-rgt-neg-in67.4%
sub-neg67.4%
metadata-eval67.4%
+-commutative67.4%
distribute-neg-in67.4%
metadata-eval67.4%
sub-neg67.4%
Simplified67.4%
Taylor expanded in z around 0 56.6%
Taylor expanded in y around inf 39.3%
Final simplification39.3%
(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.3%
sub-neg89.3%
+-commutative89.3%
associate-+l+89.3%
fma-define89.3%
sub-neg89.3%
metadata-eval89.3%
sub-neg89.3%
log1p-define99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in t around inf 39.0%
neg-mul-139.0%
Simplified39.0%
Final simplification39.0%
herbie shell --seed 2024055
(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))