
(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 18 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)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), (log(y) * (-1.0 + x))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 90.6%
+-commutative90.6%
fma-define90.6%
sub-neg90.6%
metadata-eval90.6%
sub-neg90.6%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (log y) (+ -1.0 x))
(*
(+ z -1.0)
(* y (+ -1.0 (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5))))))
t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * ((y * ((y * (-0.25d0)) - 0.3333333333333333d0)) - 0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * Float64(Float64(y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * N[(N[(y * N[(N[(y * -0.25), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 90.6%
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 (or (<= (+ -1.0 x) -20000000000000.0) (not (<= (+ -1.0 x) -0.02)))
(+ t_1 (- (* x (log y)) t))
(- t_1 (+ (log y) t)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (1.0 - z);
double tmp;
if (((-1.0 + x) <= -20000000000000.0) || !((-1.0 + x) <= -0.02)) {
tmp = t_1 + ((x * log(y)) - t);
} else {
tmp = t_1 - (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) :: t_1
real(8) :: tmp
t_1 = y * (1.0d0 - z)
if ((((-1.0d0) + x) <= (-20000000000000.0d0)) .or. (.not. (((-1.0d0) + x) <= (-0.02d0)))) then
tmp = t_1 + ((x * log(y)) - t)
else
tmp = t_1 - (log(y) + 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 (((-1.0 + x) <= -20000000000000.0) || !((-1.0 + x) <= -0.02)) {
tmp = t_1 + ((x * Math.log(y)) - t);
} else {
tmp = t_1 - (Math.log(y) + t);
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (1.0 - z) tmp = 0 if ((-1.0 + x) <= -20000000000000.0) or not ((-1.0 + x) <= -0.02): tmp = t_1 + ((x * math.log(y)) - t) else: tmp = t_1 - (math.log(y) + t) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(1.0 - z)) tmp = 0.0 if ((Float64(-1.0 + x) <= -20000000000000.0) || !(Float64(-1.0 + x) <= -0.02)) tmp = Float64(t_1 + Float64(Float64(x * log(y)) - t)); else tmp = Float64(t_1 - Float64(log(y) + t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (1.0 - z); tmp = 0.0; if (((-1.0 + x) <= -20000000000000.0) || ~(((-1.0 + x) <= -0.02))) tmp = t_1 + ((x * log(y)) - t); else tmp = t_1 - (log(y) + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -20000000000000.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.02]], $MachinePrecision]], N[(t$95$1 + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - z\right)\\
\mathbf{if}\;-1 + x \leq -20000000000000 \lor \neg \left(-1 + x \leq -0.02\right):\\
\;\;\;\;t\_1 + \left(x \cdot \log y - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \left(\log y + t\right)\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -2e13 or -0.0200000000000000004 < (-.f64 x #s(literal 1 binary64)) Initial program 96.1%
Taylor expanded in y around 0 99.7%
Taylor expanded in y around 0 99.7%
associate--l+99.7%
mul-1-neg99.7%
distribute-rgt-neg-out99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
unsub-neg99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 98.3%
*-commutative98.3%
Simplified98.3%
if -2e13 < (-.f64 x #s(literal 1 binary64)) < -0.0200000000000000004Initial program 84.8%
Taylor expanded in y around 0 99.0%
Taylor expanded in y around 0 98.8%
associate--l+98.9%
mul-1-neg98.9%
distribute-rgt-neg-out98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
distribute-neg-in98.9%
metadata-eval98.9%
unsub-neg98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 97.6%
sub-neg97.6%
neg-mul-197.6%
+-commutative97.6%
associate-+l+97.6%
sub-neg97.6%
metadata-eval97.6%
distribute-neg-in97.6%
+-commutative97.6%
distribute-rgt-neg-in97.6%
neg-mul-197.6%
metadata-eval97.6%
sub-neg97.6%
+-commutative97.6%
associate-+r+97.6%
sub-neg97.6%
sub-neg97.6%
associate--r+97.6%
Simplified97.6%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -20000000000000.0) (not (<= (+ -1.0 x) -1.0))) (- (* (log y) (+ -1.0 x)) t) (- (* y (- 1.0 z)) (+ (log y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -20000000000000.0) || !((-1.0 + x) <= -1.0)) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = (y * (1.0 - z)) - (log(y) + t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((((-1.0d0) + x) <= (-20000000000000.0d0)) .or. (.not. (((-1.0d0) + x) <= (-1.0d0)))) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = (y * (1.0d0 - z)) - (log(y) + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -20000000000000.0) || !((-1.0 + x) <= -1.0)) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = (y * (1.0 - z)) - (Math.log(y) + t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -20000000000000.0) or not ((-1.0 + x) <= -1.0): tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = (y * (1.0 - z)) - (math.log(y) + t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -20000000000000.0) || !(Float64(-1.0 + x) <= -1.0)) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(y * Float64(1.0 - z)) - Float64(log(y) + t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -20000000000000.0) || ~(((-1.0 + x) <= -1.0))) tmp = (log(y) * (-1.0 + x)) - t; else tmp = (y * (1.0 - z)) - (log(y) + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -20000000000000.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -20000000000000 \lor \neg \left(-1 + x \leq -1\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - \left(\log y + t\right)\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -2e13 or -1 < (-.f64 x #s(literal 1 binary64)) Initial program 96.2%
+-commutative96.2%
fma-define96.2%
sub-neg96.2%
metadata-eval96.2%
sub-neg96.2%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 96.2%
if -2e13 < (-.f64 x #s(literal 1 binary64)) < -1Initial program 84.5%
Taylor expanded in y around 0 99.0%
Taylor expanded in y around 0 98.8%
associate--l+98.8%
mul-1-neg98.8%
distribute-rgt-neg-out98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
distribute-neg-in98.8%
metadata-eval98.8%
unsub-neg98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in x around 0 98.2%
sub-neg98.2%
neg-mul-198.2%
+-commutative98.2%
associate-+l+98.2%
sub-neg98.2%
metadata-eval98.2%
distribute-neg-in98.2%
+-commutative98.2%
distribute-rgt-neg-in98.2%
neg-mul-198.2%
metadata-eval98.2%
sub-neg98.2%
+-commutative98.2%
associate-+r+98.2%
sub-neg98.2%
sub-neg98.2%
associate--r+98.2%
Simplified98.2%
Final simplification97.2%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (+ z -1.0) (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5)))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5)))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * N[(N[(y * -0.3333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right)\right) - t
\end{array}
Initial program 90.6%
Taylor expanded in y around 0 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* y (+ (- 1.0 z) (* -0.5 (* y (+ z -1.0)))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + (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 = ((log(y) * ((-1.0d0) + x)) + (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 ((Math.log(y) * (-1.0 + x)) + (y * ((1.0 - z) + (-0.5 * (y * (z + -1.0)))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + (y * ((1.0 - z) + (-0.5 * (y * (z + -1.0)))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + 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 = ((log(y) * (-1.0 + x)) + (y * ((1.0 - z) + (-0.5 * (y * (z + -1.0)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $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(\log y \cdot \left(-1 + x\right) + 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 90.6%
Taylor expanded in y around 0 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* (+ z -1.0) (* y (+ -1.0 (* y -0.5))))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) + ((z + (-1.0d0)) * (y * ((-1.0d0) + (y * (-0.5d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * -0.5))))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + ((z + -1.0) * (y * (-1.0 + (y * -0.5))))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot -0.5\right)\right)\right) - t
\end{array}
Initial program 90.6%
Taylor expanded in y around 0 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -370000000.0) (not (<= t 4.6e-15))) (- (* x (log y)) t) (* (log y) (+ -1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -370000000.0) || !(t <= 4.6e-15)) {
tmp = (x * log(y)) - t;
} else {
tmp = log(y) * (-1.0 + x);
}
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 <= (-370000000.0d0)) .or. (.not. (t <= 4.6d-15))) then
tmp = (x * log(y)) - t
else
tmp = log(y) * ((-1.0d0) + x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -370000000.0) || !(t <= 4.6e-15)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = Math.log(y) * (-1.0 + x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -370000000.0) or not (t <= 4.6e-15): tmp = (x * math.log(y)) - t else: tmp = math.log(y) * (-1.0 + x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -370000000.0) || !(t <= 4.6e-15)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(log(y) * Float64(-1.0 + x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -370000000.0) || ~((t <= 4.6e-15))) tmp = (x * log(y)) - t; else tmp = log(y) * (-1.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -370000000.0], N[Not[LessEqual[t, 4.6e-15]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -370000000 \lor \neg \left(t \leq 4.6 \cdot 10^{-15}\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\end{array}
\end{array}
if t < -3.7e8 or 4.59999999999999981e-15 < t Initial program 92.5%
+-commutative92.5%
fma-define92.5%
sub-neg92.5%
metadata-eval92.5%
sub-neg92.5%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 92.3%
Taylor expanded in x around inf 92.2%
if -3.7e8 < t < 4.59999999999999981e-15Initial program 88.8%
+-commutative88.8%
fma-define88.8%
sub-neg88.8%
metadata-eval88.8%
sub-neg88.8%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 87.5%
Taylor expanded in t around 0 87.3%
Final simplification89.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.8e+16) (not (<= t 3600000000.0))) (- (* y (* z (+ -1.0 (* y -0.5)))) t) (* (log y) (+ -1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.8e+16) || !(t <= 3600000000.0)) {
tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
} else {
tmp = log(y) * (-1.0 + x);
}
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.8d+16)) .or. (.not. (t <= 3600000000.0d0))) then
tmp = (y * (z * ((-1.0d0) + (y * (-0.5d0))))) - t
else
tmp = log(y) * ((-1.0d0) + x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.8e+16) || !(t <= 3600000000.0)) {
tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
} else {
tmp = Math.log(y) * (-1.0 + x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.8e+16) or not (t <= 3600000000.0): tmp = (y * (z * (-1.0 + (y * -0.5)))) - t else: tmp = math.log(y) * (-1.0 + x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.8e+16) || !(t <= 3600000000.0)) tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - t); else tmp = Float64(log(y) * Float64(-1.0 + x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.8e+16) || ~((t <= 3600000000.0))) tmp = (y * (z * (-1.0 + (y * -0.5)))) - t; else tmp = log(y) * (-1.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.8e+16], N[Not[LessEqual[t, 3600000000.0]], $MachinePrecision]], N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+16} \lor \neg \left(t \leq 3600000000\right):\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\end{array}
\end{array}
if t < -1.8e16 or 3.6e9 < t Initial program 92.1%
Taylor expanded in y around 0 99.8%
Taylor expanded in z around inf 79.8%
if -1.8e16 < t < 3.6e9Initial program 89.2%
+-commutative89.2%
fma-define89.2%
sub-neg89.2%
metadata-eval89.2%
sub-neg89.2%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 88.1%
Taylor expanded in t around 0 87.9%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6.2e+61) (not (<= x 2.9e+56))) (* x (log y)) (- (- (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.2e+61) || !(x <= 2.9e+56)) {
tmp = x * log(y);
} else {
tmp = -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 <= (-6.2d+61)) .or. (.not. (x <= 2.9d+56))) then
tmp = x * log(y)
else
tmp = -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 <= -6.2e+61) || !(x <= 2.9e+56)) {
tmp = x * Math.log(y);
} else {
tmp = -Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6.2e+61) or not (x <= 2.9e+56): tmp = x * math.log(y) else: tmp = -math.log(y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6.2e+61) || !(x <= 2.9e+56)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -6.2e+61) || ~((x <= 2.9e+56))) tmp = x * log(y); else tmp = -log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6.2e+61], N[Not[LessEqual[x, 2.9e+56]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+61} \lor \neg \left(x \leq 2.9 \cdot 10^{+56}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\
\end{array}
\end{array}
if x < -6.1999999999999998e61 or 2.90000000000000007e56 < x Initial program 97.8%
+-commutative97.8%
fma-define97.8%
sub-neg97.8%
metadata-eval97.8%
sub-neg97.8%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in t around inf 68.2%
sub-neg68.2%
sub-neg68.2%
metadata-eval68.2%
associate-/l*68.1%
+-commutative68.1%
sub-neg68.1%
metadata-eval68.1%
associate-/l*65.4%
+-commutative65.4%
metadata-eval65.4%
Simplified65.4%
Taylor expanded in x around inf 82.5%
*-commutative82.5%
Simplified82.5%
if -6.1999999999999998e61 < x < 2.90000000000000007e56Initial program 86.2%
+-commutative86.2%
fma-define86.2%
sub-neg86.2%
metadata-eval86.2%
sub-neg86.2%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 85.0%
Taylor expanded in x around 0 74.8%
neg-mul-174.8%
Simplified74.8%
Final simplification77.7%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -4.8e+61) (not (<= x 2.1e+67)))
(* x (log y))
(-
(* y (* z (+ -1.0 (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5)))))
t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.8e+61) || !(x <= 2.1e+67)) {
tmp = x * log(y);
} else {
tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-4.8d+61)) .or. (.not. (x <= 2.1d+67))) then
tmp = x * log(y)
else
tmp = (y * (z * ((-1.0d0) + (y * ((y * ((y * (-0.25d0)) - 0.3333333333333333d0)) - 0.5d0))))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.8e+61) || !(x <= 2.1e+67)) {
tmp = x * Math.log(y);
} else {
tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.8e+61) or not (x <= 2.1e+67): tmp = x * math.log(y) else: tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.8e+61) || !(x <= 2.1e+67)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(Float64(y * Float64(Float64(y * -0.25) - 0.3333333333333333)) - 0.5))))) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4.8e+61) || ~((x <= 2.1e+67))) tmp = x * log(y); else tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.8e+61], N[Not[LessEqual[x, 2.1e+67]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+61} \lor \neg \left(x \leq 2.1 \cdot 10^{+67}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;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}
\end{array}
if x < -4.7999999999999998e61 or 2.1000000000000001e67 < x Initial program 97.8%
+-commutative97.8%
fma-define97.8%
sub-neg97.8%
metadata-eval97.8%
sub-neg97.8%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in t around inf 68.2%
sub-neg68.2%
sub-neg68.2%
metadata-eval68.2%
associate-/l*68.1%
+-commutative68.1%
sub-neg68.1%
metadata-eval68.1%
associate-/l*65.4%
+-commutative65.4%
metadata-eval65.4%
Simplified65.4%
Taylor expanded in x around inf 82.5%
*-commutative82.5%
Simplified82.5%
if -4.7999999999999998e61 < x < 2.1000000000000001e67Initial program 86.2%
Taylor expanded in y around 0 99.4%
Taylor expanded in x around 0 89.2%
mul-1-neg89.2%
Simplified89.2%
Taylor expanded in z around inf 60.4%
Final simplification68.8%
(FPCore (x y z t) :precision binary64 (+ (* y (- 1.0 z)) (- (* (log y) (+ -1.0 x)) t)))
double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) + ((log(y) * (-1.0 + x)) - t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * (1.0d0 - z)) + ((log(y) * ((-1.0d0) + x)) - t)
end function
public static double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) + ((Math.log(y) * (-1.0 + x)) - t);
}
def code(x, y, z, t): return (y * (1.0 - z)) + ((math.log(y) * (-1.0 + x)) - t)
function code(x, y, z, t) return Float64(Float64(y * Float64(1.0 - z)) + Float64(Float64(log(y) * Float64(-1.0 + x)) - t)) end
function tmp = code(x, y, z, t) tmp = (y * (1.0 - z)) + ((log(y) * (-1.0 + x)) - t); end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(1 - z\right) + \left(\log y \cdot \left(-1 + x\right) - t\right)
\end{array}
Initial program 90.6%
Taylor expanded in y around 0 99.4%
Taylor expanded in y around 0 99.3%
associate--l+99.3%
mul-1-neg99.3%
distribute-rgt-neg-out99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
unsub-neg99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
Simplified99.3%
(FPCore (x y z t) :precision binary64 (- (* (log y) (+ -1.0 x)) t))
double code(double x, double y, double z, double t) {
return (log(y) * (-1.0 + x)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (log(y) * ((-1.0d0) + x)) - t
end function
public static double code(double x, double y, double z, double t) {
return (Math.log(y) * (-1.0 + x)) - t;
}
def code(x, y, z, t): return (math.log(y) * (-1.0 + x)) - t
function code(x, y, z, t) return Float64(Float64(log(y) * Float64(-1.0 + x)) - t) end
function tmp = code(x, y, z, t) tmp = (log(y) * (-1.0 + x)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log y \cdot \left(-1 + x\right) - t
\end{array}
Initial program 90.6%
+-commutative90.6%
fma-define90.6%
sub-neg90.6%
metadata-eval90.6%
sub-neg90.6%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 89.9%
Final simplification89.9%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.4e-8)
(- t)
(if (<= t 6.5e-16)
(* y (- (* -0.5 (* z y)) z))
(+ -1.0 (* t (+ -1.0 (/ 1.0 t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.4e-8) {
tmp = -t;
} else if (t <= 6.5e-16) {
tmp = y * ((-0.5 * (z * y)) - z);
} else {
tmp = -1.0 + (t * (-1.0 + (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 (t <= (-1.4d-8)) then
tmp = -t
else if (t <= 6.5d-16) then
tmp = y * (((-0.5d0) * (z * y)) - z)
else
tmp = (-1.0d0) + (t * ((-1.0d0) + (1.0d0 / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.4e-8) {
tmp = -t;
} else if (t <= 6.5e-16) {
tmp = y * ((-0.5 * (z * y)) - z);
} else {
tmp = -1.0 + (t * (-1.0 + (1.0 / t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.4e-8: tmp = -t elif t <= 6.5e-16: tmp = y * ((-0.5 * (z * y)) - z) else: tmp = -1.0 + (t * (-1.0 + (1.0 / t))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.4e-8) tmp = Float64(-t); elseif (t <= 6.5e-16) tmp = Float64(y * Float64(Float64(-0.5 * Float64(z * y)) - z)); else tmp = Float64(-1.0 + Float64(t * Float64(-1.0 + Float64(1.0 / t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.4e-8) tmp = -t; elseif (t <= 6.5e-16) tmp = y * ((-0.5 * (z * y)) - z); else tmp = -1.0 + (t * (-1.0 + (1.0 / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.4e-8], (-t), If[LessEqual[t, 6.5e-16], N[(y * N[(N[(-0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(-1.0 + N[(t * N[(-1.0 + N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{-8}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-16}:\\
\;\;\;\;y \cdot \left(-0.5 \cdot \left(z \cdot y\right) - z\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + t \cdot \left(-1 + \frac{1}{t}\right)\\
\end{array}
\end{array}
if t < -1.4e-8Initial program 92.7%
+-commutative92.7%
fma-define92.7%
sub-neg92.7%
metadata-eval92.7%
sub-neg92.7%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 68.8%
neg-mul-168.8%
Simplified68.8%
if -1.4e-8 < t < 6.50000000000000011e-16Initial program 88.4%
+-commutative88.4%
fma-define88.4%
sub-neg88.4%
metadata-eval88.4%
sub-neg88.4%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 76.5%
sub-neg76.5%
log1p-define87.9%
+-commutative87.9%
mul-1-neg87.9%
unsub-neg87.9%
sub-neg87.9%
metadata-eval87.9%
associate-/l*87.8%
+-commutative87.8%
sub-neg87.8%
log1p-define87.8%
Simplified87.8%
Taylor expanded in z around inf 3.3%
*-commutative3.3%
sub-neg3.3%
log1p-undefine13.8%
Simplified13.8%
Taylor expanded in y around 0 13.4%
if 6.50000000000000011e-16 < t Initial program 92.7%
+-commutative92.7%
fma-define92.7%
sub-neg92.7%
metadata-eval92.7%
sub-neg92.7%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 64.6%
neg-mul-164.6%
Simplified64.6%
expm1-log1p-u0.4%
expm1-undefine0.4%
Applied egg-rr0.4%
sub-neg0.4%
log1p-undefine0.4%
rem-exp-log64.6%
unsub-neg64.6%
metadata-eval64.6%
Simplified64.6%
Taylor expanded in t around inf 64.6%
Final simplification40.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 90.6%
Taylor expanded in y around 0 99.5%
Taylor expanded in x around 0 62.2%
mul-1-neg62.2%
Simplified62.2%
Taylor expanded in z around inf 44.4%
Final simplification44.4%
(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 90.6%
Taylor expanded in y around 0 99.4%
Taylor expanded in z around inf 44.3%
Final simplification44.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 90.6%
+-commutative90.6%
fma-define90.6%
sub-neg90.6%
metadata-eval90.6%
sub-neg90.6%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 35.4%
neg-mul-135.4%
Simplified35.4%
(FPCore (x y z t) :precision binary64 0.0)
double code(double x, double y, double z, double t) {
return 0.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 0.0d0
end function
public static double code(double x, double y, double z, double t) {
return 0.0;
}
def code(x, y, z, t): return 0.0
function code(x, y, z, t) return 0.0 end
function tmp = code(x, y, z, t) tmp = 0.0; end
code[x_, y_, z_, t_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 90.6%
+-commutative90.6%
fma-define90.6%
sub-neg90.6%
metadata-eval90.6%
sub-neg90.6%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 35.4%
neg-mul-135.4%
Simplified35.4%
expm1-log1p-u17.2%
expm1-undefine17.0%
Applied egg-rr17.0%
sub-neg17.0%
log1p-undefine17.0%
rem-exp-log35.2%
unsub-neg35.2%
metadata-eval35.2%
Simplified35.2%
Taylor expanded in t around 0 2.4%
metadata-eval2.4%
Applied egg-rr2.4%
herbie shell --seed 2024172
(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))