
(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 17 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 88.2%
sub-neg88.2%
+-commutative88.2%
associate-+l+88.2%
fma-define88.2%
sub-neg88.2%
metadata-eval88.2%
sub-neg88.2%
log1p-define99.8%
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)) (* (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 88.2%
+-commutative88.2%
fma-define88.2%
sub-neg88.2%
metadata-eval88.2%
sub-neg88.2%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(-
(+
(*
y
(+
(*
y
(+
(* (+ z -1.0) -0.5)
(* y (- (* (+ z -1.0) -0.3333333333333333) (* -0.25 (* y (- 1.0 z)))))))
(- 1.0 z)))
(* (log y) (+ -1.0 x)))
t))
double code(double x, double y, double z, double t) {
return ((y * ((y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) - (-0.25 * (y * (1.0 - z))))))) + (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 * ((y * (((z + (-1.0d0)) * (-0.5d0)) + (y * (((z + (-1.0d0)) * (-0.3333333333333333d0)) - ((-0.25d0) * (y * (1.0d0 - z))))))) + (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 * ((y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) - (-0.25 * (y * (1.0 - z))))))) + (1.0 - z))) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return ((y * ((y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) - (-0.25 * (y * (1.0 - z))))))) + (1.0 - z))) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(y * Float64(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(1.0 - z))))))) + Float64(1.0 - z))) + Float64(log(y) * Float64(-1.0 + x))) - t) end
function tmp = code(x, y, z, t) tmp = ((y * ((y * (((z + -1.0) * -0.5) + (y * (((z + -1.0) * -0.3333333333333333) - (-0.25 * (y * (1.0 - z))))))) + (1.0 - z))) + (log(y) * (-1.0 + x))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(y * N[(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[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot \left(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(1 - z\right)\right)\right)\right) + \left(1 - z\right)\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 88.2%
Taylor expanded in y around 0 99.6%
Final simplification99.6%
(FPCore (x y z t)
:precision binary64
(-
(+
(*
(+ z -1.0)
(* y (- -1.0 (* y (+ 0.5 (* y (- 0.3333333333333333 (* y -0.25))))))))
(* (log y) (+ -1.0 x)))
t))
double code(double x, double y, double z, double t) {
return (((z + -1.0) * (y * (-1.0 - (y * (0.5 + (y * (0.3333333333333333 - (y * -0.25)))))))) + (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 = (((z + (-1.0d0)) * (y * ((-1.0d0) - (y * (0.5d0 + (y * (0.3333333333333333d0 - (y * (-0.25d0))))))))) + (log(y) * ((-1.0d0) + x))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((z + -1.0) * (y * (-1.0 - (y * (0.5 + (y * (0.3333333333333333 - (y * -0.25)))))))) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return (((z + -1.0) * (y * (-1.0 - (y * (0.5 + (y * (0.3333333333333333 - (y * -0.25)))))))) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 - Float64(y * Float64(0.5 + Float64(y * Float64(0.3333333333333333 - Float64(y * -0.25)))))))) + Float64(log(y) * Float64(-1.0 + x))) - t) end
function tmp = code(x, y, z, t) tmp = (((z + -1.0) * (y * (-1.0 - (y * (0.5 + (y * (0.3333333333333333 - (y * -0.25)))))))) + (log(y) * (-1.0 + x))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(-1.0 - N[(y * N[(0.5 + N[(y * N[(0.3333333333333333 - N[(y * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + -1\right) \cdot \left(y \cdot \left(-1 - y \cdot \left(0.5 + y \cdot \left(0.3333333333333333 - y \cdot -0.25\right)\right)\right)\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 88.2%
Taylor expanded in y around 0 99.6%
Final simplification99.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- 1.0 z))))
(if (or (<= (+ -1.0 x) -500000000000.0) (not (<= (+ -1.0 x) -1.0)))
(- (+ (* x (log y)) t_1) 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) <= -500000000000.0) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * log(y)) + t_1) - 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) <= (-500000000000.0d0)) .or. (.not. (((-1.0d0) + x) <= (-1.0d0)))) then
tmp = ((x * log(y)) + t_1) - 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) <= -500000000000.0) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * Math.log(y)) + t_1) - 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) <= -500000000000.0) or not ((-1.0 + x) <= -1.0): tmp = ((x * math.log(y)) + t_1) - 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) <= -500000000000.0) || !(Float64(-1.0 + x) <= -1.0)) tmp = Float64(Float64(Float64(x * log(y)) + t_1) - t); else tmp = Float64(Float64(t_1 - 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) <= -500000000000.0) || ~(((-1.0 + x) <= -1.0))) tmp = ((x * log(y)) + t_1) - 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], -500000000000.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], N[(N[(t$95$1 - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - z\right)\\
\mathbf{if}\;-1 + x \leq -500000000000 \lor \neg \left(-1 + x \leq -1\right):\\
\;\;\;\;\left(x \cdot \log y + t\_1\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -5e11 or -1 < (-.f64 x #s(literal 1 binary64)) Initial program 94.9%
+-commutative94.9%
fma-define94.9%
sub-neg94.9%
metadata-eval94.9%
sub-neg94.9%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
mul-1-neg98.9%
unsub-neg98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in x around inf 98.2%
*-commutative98.2%
Simplified98.2%
if -5e11 < (-.f64 x #s(literal 1 binary64)) < -1Initial program 80.1%
+-commutative80.1%
fma-define80.1%
sub-neg80.1%
metadata-eval80.1%
sub-neg80.1%
log1p-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
mul-1-neg99.1%
unsub-neg99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in x around 0 99.1%
mul-1-neg99.1%
sub-neg99.1%
metadata-eval99.1%
Simplified99.1%
Final simplification98.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -500000000000.0) (not (<= (+ -1.0 x) 50.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) <= -500000000000.0) || !((-1.0 + x) <= 50.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) <= (-500000000000.0d0)) .or. (.not. (((-1.0d0) + x) <= 50.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) <= -500000000000.0) || !((-1.0 + x) <= 50.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) <= -500000000000.0) or not ((-1.0 + x) <= 50.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) <= -500000000000.0) || !(Float64(-1.0 + x) <= 50.0)) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - 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) <= -500000000000.0) || ~(((-1.0 + x) <= 50.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], -500000000000.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], 50.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $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 -500000000000 \lor \neg \left(-1 + x \leq 50\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - 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)) < -5e11 or 50 < (-.f64 x #s(literal 1 binary64)) Initial program 94.9%
+-commutative94.9%
fma-define94.9%
sub-neg94.9%
metadata-eval94.9%
sub-neg94.9%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
mul-1-neg99.4%
unsub-neg99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around 0 94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
neg-mul-194.3%
Simplified94.3%
Taylor expanded in y around 0 94.3%
if -5e11 < (-.f64 x #s(literal 1 binary64)) < 50Initial program 80.3%
+-commutative80.3%
fma-define80.3%
sub-neg80.3%
metadata-eval80.3%
sub-neg80.3%
log1p-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
mul-1-neg98.4%
unsub-neg98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 98.4%
mul-1-neg98.4%
sub-neg98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification96.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) (+ -1.0 x))))
(if (<= (+ -1.0 x) -500000000000.0)
(- t_1 t)
(if (<= (+ -1.0 x) 50.0)
(- (- (* y (- 1.0 z)) (log y)) t)
(- (+ y t_1) t)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * (-1.0 + x);
double tmp;
if ((-1.0 + x) <= -500000000000.0) {
tmp = t_1 - t;
} else if ((-1.0 + x) <= 50.0) {
tmp = ((y * (1.0 - z)) - log(y)) - t;
} else {
tmp = (y + 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 = log(y) * ((-1.0d0) + x)
if (((-1.0d0) + x) <= (-500000000000.0d0)) then
tmp = t_1 - t
else if (((-1.0d0) + x) <= 50.0d0) then
tmp = ((y * (1.0d0 - z)) - log(y)) - t
else
tmp = (y + t_1) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(y) * (-1.0 + x);
double tmp;
if ((-1.0 + x) <= -500000000000.0) {
tmp = t_1 - t;
} else if ((-1.0 + x) <= 50.0) {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
} else {
tmp = (y + t_1) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * (-1.0 + x) tmp = 0 if (-1.0 + x) <= -500000000000.0: tmp = t_1 - t elif (-1.0 + x) <= 50.0: tmp = ((y * (1.0 - z)) - math.log(y)) - t else: tmp = (y + t_1) - t return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * Float64(-1.0 + x)) tmp = 0.0 if (Float64(-1.0 + x) <= -500000000000.0) tmp = Float64(t_1 - t); elseif (Float64(-1.0 + x) <= 50.0) tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); else tmp = Float64(Float64(y + t_1) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * (-1.0 + x); tmp = 0.0; if ((-1.0 + x) <= -500000000000.0) tmp = t_1 - t; elseif ((-1.0 + x) <= 50.0) tmp = ((y * (1.0 - z)) - log(y)) - t; else tmp = (y + t_1) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(-1.0 + x), $MachinePrecision], -500000000000.0], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 50.0], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y + t$95$1), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(-1 + x\right)\\
\mathbf{if}\;-1 + x \leq -500000000000:\\
\;\;\;\;t\_1 - t\\
\mathbf{elif}\;-1 + x \leq 50:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y + t\_1\right) - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -5e11Initial program 98.3%
+-commutative98.3%
fma-define98.3%
sub-neg98.3%
metadata-eval98.3%
sub-neg98.3%
log1p-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
mul-1-neg99.6%
unsub-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in z around 0 98.3%
sub-neg98.3%
metadata-eval98.3%
+-commutative98.3%
neg-mul-198.3%
Simplified98.3%
Taylor expanded in y around 0 98.3%
if -5e11 < (-.f64 x #s(literal 1 binary64)) < 50Initial program 80.3%
+-commutative80.3%
fma-define80.3%
sub-neg80.3%
metadata-eval80.3%
sub-neg80.3%
log1p-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
mul-1-neg98.4%
unsub-neg98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 98.4%
mul-1-neg98.4%
sub-neg98.4%
metadata-eval98.4%
Simplified98.4%
if 50 < (-.f64 x #s(literal 1 binary64)) Initial program 91.1%
+-commutative91.1%
fma-define91.1%
sub-neg91.1%
metadata-eval91.1%
sub-neg91.1%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
unsub-neg99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in z around 0 89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
neg-mul-189.9%
Simplified89.9%
Final simplification96.2%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ z -1.0) (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5))))) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return (((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) + (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 = (((z + (-1.0d0)) * (y * ((-1.0d0) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0))))) + (log(y) * ((-1.0d0) + x))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return (((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(z + -1.0) * Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5))))) + Float64(log(y) * Float64(-1.0 + x))) - t) end
function tmp = code(x, y, z, t) tmp = (((z + -1.0) * (y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5))))) + (log(y) * (-1.0 + x))) - t; end
code[x_, y_, z_, t_] := N[(N[(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] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 88.2%
Taylor expanded in y around 0 99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (- (+ (* y (* (+ z -1.0) (+ -1.0 (* y -0.5)))) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return ((y * ((z + -1.0) * (-1.0 + (y * -0.5)))) + (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 * ((z + (-1.0d0)) * ((-1.0d0) + (y * (-0.5d0))))) + (log(y) * ((-1.0d0) + x))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((y * ((z + -1.0) * (-1.0 + (y * -0.5)))) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return ((y * ((z + -1.0) * (-1.0 + (y * -0.5)))) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(y * Float64(Float64(z + -1.0) * Float64(-1.0 + Float64(y * -0.5)))) + Float64(log(y) * Float64(-1.0 + x))) - t) end
function tmp = code(x, y, z, t) tmp = ((y * ((z + -1.0) * (-1.0 + (y * -0.5)))) + (log(y) * (-1.0 + x))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(y * N[(N[(z + -1.0), $MachinePrecision] * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot \left(\left(z + -1\right) \cdot \left(-1 + y \cdot -0.5\right)\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 88.2%
Taylor expanded in y around 0 99.6%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
associate-*r*99.4%
distribute-rgt-out99.4%
sub-neg99.4%
metadata-eval99.4%
*-commutative99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= z -5e+182) (- (* z (log1p (- y))) t) (if (<= z 2.8e+254) (- (* (log y) (+ -1.0 x)) t) (* z (- (/ (- t) z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+182) {
tmp = (z * log1p(-y)) - t;
} else if (z <= 2.8e+254) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = z * ((-t / z) - y);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+182) {
tmp = (z * Math.log1p(-y)) - t;
} else if (z <= 2.8e+254) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = z * ((-t / z) - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5e+182: tmp = (z * math.log1p(-y)) - t elif z <= 2.8e+254: tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = z * ((-t / z) - y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5e+182) tmp = Float64(Float64(z * log1p(Float64(-y))) - t); elseif (z <= 2.8e+254) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(z * Float64(Float64(Float64(-t) / z) - y)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -5e+182], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[z, 2.8e+254], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(z * N[(N[((-t) / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+182}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+254}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{-t}{z} - y\right)\\
\end{array}
\end{array}
if z < -4.99999999999999973e182Initial program 69.4%
+-commutative69.4%
fma-define69.4%
sub-neg69.4%
metadata-eval69.4%
sub-neg69.4%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 69.3%
sub-neg69.3%
log1p-define99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
associate-/l*99.7%
fma-define99.7%
+-commutative99.7%
mul-1-neg99.7%
distribute-neg-frac299.7%
sub-neg99.7%
log1p-define99.7%
Simplified99.7%
Taylor expanded in z around inf 41.7%
sub-neg41.7%
log1p-undefine72.8%
Simplified72.8%
if -4.99999999999999973e182 < z < 2.79999999999999982e254Initial program 94.4%
+-commutative94.4%
fma-define94.4%
sub-neg94.4%
metadata-eval94.4%
sub-neg94.4%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
mul-1-neg99.7%
unsub-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
neg-mul-194.3%
Simplified94.3%
Taylor expanded in y around 0 94.0%
if 2.79999999999999982e254 < z Initial program 34.7%
+-commutative34.7%
fma-define34.7%
sub-neg34.7%
metadata-eval34.7%
sub-neg34.7%
log1p-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
mul-1-neg100.0%
unsub-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 83.9%
mul-1-neg83.9%
distribute-rgt-neg-in83.9%
Simplified83.9%
Taylor expanded in z around inf 83.9%
neg-mul-183.9%
+-commutative83.9%
unsub-neg83.9%
mul-1-neg83.9%
distribute-neg-frac283.9%
Simplified83.9%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6.6e-21) (not (<= x 38.0))) (- (* x (log y)) t) (- (- y (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.6e-21) || !(x <= 38.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 <= (-6.6d-21)) .or. (.not. (x <= 38.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 <= -6.6e-21) || !(x <= 38.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 <= -6.6e-21) or not (x <= 38.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 <= -6.6e-21) || !(x <= 38.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 <= -6.6e-21) || ~((x <= 38.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, -6.6e-21], N[Not[LessEqual[x, 38.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 -6.6 \cdot 10^{-21} \lor \neg \left(x \leq 38\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\end{array}
\end{array}
if x < -6.60000000000000018e-21 or 38 < x Initial program 93.6%
+-commutative93.6%
fma-define93.6%
sub-neg93.6%
metadata-eval93.6%
sub-neg93.6%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
mul-1-neg99.4%
unsub-neg99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around 0 93.0%
sub-neg93.0%
metadata-eval93.0%
+-commutative93.0%
neg-mul-193.0%
Simplified93.0%
Taylor expanded in x around inf 92.3%
*-commutative92.3%
Simplified92.3%
if -6.60000000000000018e-21 < x < 38Initial program 81.6%
+-commutative81.6%
fma-define81.6%
sub-neg81.6%
metadata-eval81.6%
sub-neg81.6%
log1p-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
mul-1-neg98.4%
unsub-neg98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in z around 0 79.4%
sub-neg79.4%
metadata-eval79.4%
+-commutative79.4%
neg-mul-179.4%
Simplified79.4%
Taylor expanded in x around 0 79.4%
mul-1-neg79.4%
unsub-neg79.4%
Simplified79.4%
Final simplification86.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -255000.0) (not (<= x 1860.0))) (- (* x (log y)) t) (- (- t) (* z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -255000.0) || !(x <= 1860.0)) {
tmp = (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 ((x <= (-255000.0d0)) .or. (.not. (x <= 1860.0d0))) then
tmp = (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 ((x <= -255000.0) || !(x <= 1860.0)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = -t - (z * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -255000.0) or not (x <= 1860.0): tmp = (x * math.log(y)) - t else: tmp = -t - (z * y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -255000.0) || !(x <= 1860.0)) tmp = Float64(Float64(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 ((x <= -255000.0) || ~((x <= 1860.0))) tmp = (x * log(y)) - t; else tmp = -t - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -255000.0], N[Not[LessEqual[x, 1860.0]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -255000 \lor \neg \left(x \leq 1860\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) - z \cdot y\\
\end{array}
\end{array}
if x < -255000 or 1860 < x Initial program 94.9%
+-commutative94.9%
fma-define94.9%
sub-neg94.9%
metadata-eval94.9%
sub-neg94.9%
log1p-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
mul-1-neg99.4%
unsub-neg99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around 0 94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
neg-mul-194.3%
Simplified94.3%
Taylor expanded in x around inf 93.7%
*-commutative93.7%
Simplified93.7%
if -255000 < x < 1860Initial program 80.3%
+-commutative80.3%
fma-define80.3%
sub-neg80.3%
metadata-eval80.3%
sub-neg80.3%
log1p-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
mul-1-neg98.4%
unsub-neg98.4%
+-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in z around inf 64.7%
mul-1-neg64.7%
distribute-rgt-neg-in64.7%
Simplified64.7%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 88.2%
+-commutative88.2%
fma-define88.2%
sub-neg88.2%
metadata-eval88.2%
sub-neg88.2%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
mul-1-neg99.0%
unsub-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 (<= t -190000000000.0) (- t) (if (<= t 390000000.0) (* z (- y)) (- y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -190000000000.0) {
tmp = -t;
} else if (t <= 390000000.0) {
tmp = z * -y;
} else {
tmp = 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 (t <= (-190000000000.0d0)) then
tmp = -t
else if (t <= 390000000.0d0) then
tmp = z * -y
else
tmp = y - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -190000000000.0) {
tmp = -t;
} else if (t <= 390000000.0) {
tmp = z * -y;
} else {
tmp = y - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -190000000000.0: tmp = -t elif t <= 390000000.0: tmp = z * -y else: tmp = y - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -190000000000.0) tmp = Float64(-t); elseif (t <= 390000000.0) tmp = Float64(z * Float64(-y)); else tmp = Float64(y - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -190000000000.0) tmp = -t; elseif (t <= 390000000.0) tmp = z * -y; else tmp = y - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -190000000000.0], (-t), If[LessEqual[t, 390000000.0], N[(z * (-y)), $MachinePrecision], N[(y - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -190000000000:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 390000000:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;y - t\\
\end{array}
\end{array}
if t < -1.9e11Initial program 95.7%
+-commutative95.7%
fma-define95.7%
sub-neg95.7%
metadata-eval95.7%
sub-neg95.7%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
mul-1-neg99.6%
unsub-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in z around inf 69.9%
mul-1-neg69.9%
distribute-rgt-neg-in69.9%
Simplified69.9%
Taylor expanded in y around 0 65.5%
neg-mul-165.5%
Simplified65.5%
if -1.9e11 < t < 3.9e8Initial program 80.9%
+-commutative80.9%
fma-define80.9%
sub-neg80.9%
metadata-eval80.9%
sub-neg80.9%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
mul-1-neg98.9%
unsub-neg98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in z around inf 22.3%
mul-1-neg22.3%
distribute-rgt-neg-in22.3%
Simplified22.3%
Taylor expanded in y around inf 22.2%
mul-1-neg22.2%
distribute-rgt-neg-out22.2%
Simplified22.2%
if 3.9e8 < 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 y around 0 98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
mul-1-neg98.5%
unsub-neg98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in z around 0 93.8%
sub-neg93.8%
metadata-eval93.8%
+-commutative93.8%
neg-mul-193.8%
Simplified93.8%
Taylor expanded in y around inf 67.1%
Final simplification43.8%
(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 88.2%
+-commutative88.2%
fma-define88.2%
sub-neg88.2%
metadata-eval88.2%
sub-neg88.2%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
mul-1-neg99.0%
unsub-neg99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in z around inf 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
Simplified46.1%
Final simplification46.1%
(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 88.2%
+-commutative88.2%
fma-define88.2%
sub-neg88.2%
metadata-eval88.2%
sub-neg88.2%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
mul-1-neg99.0%
unsub-neg99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in z around 0 86.9%
sub-neg86.9%
metadata-eval86.9%
+-commutative86.9%
neg-mul-186.9%
Simplified86.9%
Taylor expanded in y around inf 34.1%
(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 88.2%
+-commutative88.2%
fma-define88.2%
sub-neg88.2%
metadata-eval88.2%
sub-neg88.2%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
mul-1-neg99.0%
unsub-neg99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in z around inf 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
Simplified46.1%
Taylor expanded in y around 0 33.8%
neg-mul-133.8%
Simplified33.8%
herbie shell --seed 2024086
(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))