
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(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 * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(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 * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (- (- (- (log t) (* (log (/ 1.0 y)) x)) z) y))
double code(double x, double y, double z, double t) {
return ((log(t) - (log((1.0 / y)) * x)) - 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 = ((log(t) - (log((1.0d0 / y)) * x)) - z) - y
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(t) - (Math.log((1.0 / y)) * x)) - z) - y;
}
def code(x, y, z, t): return ((math.log(t) - (math.log((1.0 / y)) * x)) - z) - y
function code(x, y, z, t) return Float64(Float64(Float64(log(t) - Float64(log(Float64(1.0 / y)) * x)) - z) - y) end
function tmp = code(x, y, z, t) tmp = ((log(t) - (log((1.0 / y)) * x)) - z) - y; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[t], $MachinePrecision] - N[(N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log t - \log \left(\frac{1}{y}\right) \cdot x\right) - z\right) - y
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
+-commutative99.9%
associate--r+99.9%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (or (<= z -290000.0) (not (<= z 40.0)))
(- (- t_1 z) y)
(- (+ (log t) t_1) y))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if ((z <= -290000.0) || !(z <= 40.0)) {
tmp = (t_1 - z) - y;
} else {
tmp = (log(t) + t_1) - 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if ((z <= (-290000.0d0)) .or. (.not. (z <= 40.0d0))) then
tmp = (t_1 - z) - y
else
tmp = (log(t) + t_1) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if ((z <= -290000.0) || !(z <= 40.0)) {
tmp = (t_1 - z) - y;
} else {
tmp = (Math.log(t) + t_1) - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if (z <= -290000.0) or not (z <= 40.0): tmp = (t_1 - z) - y else: tmp = (math.log(t) + t_1) - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if ((z <= -290000.0) || !(z <= 40.0)) tmp = Float64(Float64(t_1 - z) - y); else tmp = Float64(Float64(log(t) + t_1) - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if ((z <= -290000.0) || ~((z <= 40.0))) tmp = (t_1 - z) - y; else tmp = (log(t) + t_1) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -290000.0], N[Not[LessEqual[z, 40.0]], $MachinePrecision]], N[(N[(t$95$1 - z), $MachinePrecision] - y), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;z \leq -290000 \lor \neg \left(z \leq 40\right):\\
\;\;\;\;\left(t_1 - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t + t_1\right) - y\\
\end{array}
\end{array}
if z < -2.9e5 or 40 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
+-commutative99.9%
associate--r+99.9%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around inf 99.2%
associate-*r*99.2%
mul-1-neg99.2%
log-rec99.2%
remove-double-neg99.2%
Simplified99.2%
if -2.9e5 < z < 40Initial program 99.8%
Taylor expanded in z around 0 99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (if (<= y 0.00039) (- (+ (log t) (* x (log y))) z) (- (- (* (log (/ 1.0 y)) (- x)) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.00039) {
tmp = (log(t) + (x * log(y))) - z;
} else {
tmp = ((log((1.0 / y)) * -x) - 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 (y <= 0.00039d0) then
tmp = (log(t) + (x * log(y))) - z
else
tmp = ((log((1.0d0 / y)) * -x) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.00039) {
tmp = (Math.log(t) + (x * Math.log(y))) - z;
} else {
tmp = ((Math.log((1.0 / y)) * -x) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 0.00039: tmp = (math.log(t) + (x * math.log(y))) - z else: tmp = ((math.log((1.0 / y)) * -x) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 0.00039) tmp = Float64(Float64(log(t) + Float64(x * log(y))) - z); else tmp = Float64(Float64(Float64(log(Float64(1.0 / y)) * Float64(-x)) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 0.00039) tmp = (log(t) + (x * log(y))) - z; else tmp = ((log((1.0 / y)) * -x) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 0.00039], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[(N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] * (-x)), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.00039:\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(\frac{1}{y}\right) \cdot \left(-x\right) - z\right) - y\\
\end{array}
\end{array}
if y < 3.89999999999999993e-4Initial program 99.8%
Taylor expanded in y around 0 99.2%
if 3.89999999999999993e-4 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
+-commutative99.9%
associate--r+99.9%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around inf 99.5%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((x * log(y)) - y) - z);
}
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(t) + (((x * log(y)) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((x * Math.log(y)) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((x * math.log(y)) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(x * log(y)) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((x * log(y)) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(x \cdot \log y - y\right) - z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (<= x -1.95e+31) (- (- (* x (log y)) z) y) (if (<= x 3.5) (- (log t) (+ y z)) (- (- (* (log (/ 1.0 y)) (- x)) z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.95e+31) {
tmp = ((x * log(y)) - z) - y;
} else if (x <= 3.5) {
tmp = log(t) - (y + z);
} else {
tmp = ((log((1.0 / y)) * -x) - 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 <= (-1.95d+31)) then
tmp = ((x * log(y)) - z) - y
else if (x <= 3.5d0) then
tmp = log(t) - (y + z)
else
tmp = ((log((1.0d0 / y)) * -x) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.95e+31) {
tmp = ((x * Math.log(y)) - z) - y;
} else if (x <= 3.5) {
tmp = Math.log(t) - (y + z);
} else {
tmp = ((Math.log((1.0 / y)) * -x) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.95e+31: tmp = ((x * math.log(y)) - z) - y elif x <= 3.5: tmp = math.log(t) - (y + z) else: tmp = ((math.log((1.0 / y)) * -x) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.95e+31) tmp = Float64(Float64(Float64(x * log(y)) - z) - y); elseif (x <= 3.5) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(Float64(Float64(log(Float64(1.0 / y)) * Float64(-x)) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.95e+31) tmp = ((x * log(y)) - z) - y; elseif (x <= 3.5) tmp = log(t) - (y + z); else tmp = ((log((1.0 / y)) * -x) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.95e+31], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 3.5], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] * (-x)), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+31}:\\
\;\;\;\;\left(x \cdot \log y - z\right) - y\\
\mathbf{elif}\;x \leq 3.5:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(\frac{1}{y}\right) \cdot \left(-x\right) - z\right) - y\\
\end{array}
\end{array}
if x < -1.95e31Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
+-commutative99.8%
associate--r+99.8%
fma-neg99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 99.8%
Taylor expanded in x around inf 99.8%
associate-*r*99.8%
mul-1-neg99.8%
log-rec99.8%
remove-double-neg99.8%
Simplified99.8%
if -1.95e31 < x < 3.5Initial program 100.0%
Taylor expanded in x around 0 98.3%
if 3.5 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
+-commutative99.7%
associate--r+99.7%
fma-neg99.7%
neg-sub099.7%
associate-+l-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in y around inf 99.7%
Taylor expanded in x around inf 99.7%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.95e+31) (not (<= x 0.102))) (- (- (* x (log y)) z) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.95e+31) || !(x <= 0.102)) {
tmp = ((x * log(y)) - z) - y;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.95d+31)) .or. (.not. (x <= 0.102d0))) then
tmp = ((x * log(y)) - z) - y
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.95e+31) || !(x <= 0.102)) {
tmp = ((x * Math.log(y)) - z) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.95e+31) or not (x <= 0.102): tmp = ((x * math.log(y)) - z) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.95e+31) || !(x <= 0.102)) tmp = Float64(Float64(Float64(x * log(y)) - z) - y); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.95e+31) || ~((x <= 0.102))) tmp = ((x * log(y)) - z) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.95e+31], N[Not[LessEqual[x, 0.102]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+31} \lor \neg \left(x \leq 0.102\right):\\
\;\;\;\;\left(x \cdot \log y - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.95e31 or 0.101999999999999993 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
+-commutative99.8%
associate--r+99.8%
fma-neg99.7%
neg-sub099.7%
associate-+l-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in y around inf 99.8%
Taylor expanded in x around inf 99.8%
associate-*r*99.8%
mul-1-neg99.8%
log-rec99.8%
remove-double-neg99.8%
Simplified99.8%
if -1.95e31 < x < 0.101999999999999993Initial program 100.0%
Taylor expanded in x around 0 98.3%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3e+64) (not (<= x 1.65e+61))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3e+64) || !(x <= 1.65e+61)) {
tmp = (x * log(y)) - y;
} else {
tmp = log(t) - (y + z);
}
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 <= (-3d+64)) .or. (.not. (x <= 1.65d+61))) then
tmp = (x * log(y)) - y
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3e+64) || !(x <= 1.65e+61)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3e+64) or not (x <= 1.65e+61): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3e+64) || !(x <= 1.65e+61)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3e+64) || ~((x <= 1.65e+61))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3e+64], N[Not[LessEqual[x, 1.65e+61]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+64} \lor \neg \left(x \leq 1.65 \cdot 10^{+61}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -3.0000000000000002e64 or 1.6499999999999999e61 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
+-commutative99.7%
associate--r+99.7%
fma-neg99.7%
neg-sub099.7%
associate-+l-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in y around inf 99.7%
Taylor expanded in x around inf 99.7%
Taylor expanded in z around 0 81.7%
associate-*r*81.7%
fma-neg81.7%
log-rec81.7%
neg-mul-181.7%
associate-*r*81.7%
metadata-eval81.7%
*-lft-identity81.7%
fma-neg81.7%
Simplified81.7%
if -3.0000000000000002e64 < x < 1.6499999999999999e61Initial program 100.0%
Taylor expanded in x around 0 96.6%
Final simplification90.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.6e+69) (not (<= x 6e+43))) (- (* x (log y)) z) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.6e+69) || !(x <= 6e+43)) {
tmp = (x * log(y)) - z;
} else {
tmp = log(t) - (y + z);
}
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 <= (-3.6d+69)) .or. (.not. (x <= 6d+43))) then
tmp = (x * log(y)) - z
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.6e+69) || !(x <= 6e+43)) {
tmp = (x * Math.log(y)) - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.6e+69) or not (x <= 6e+43): tmp = (x * math.log(y)) - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.6e+69) || !(x <= 6e+43)) tmp = Float64(Float64(x * log(y)) - z); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.6e+69) || ~((x <= 6e+43))) tmp = (x * log(y)) - z; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.6e+69], N[Not[LessEqual[x, 6e+43]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+69} \lor \neg \left(x \leq 6 \cdot 10^{+43}\right):\\
\;\;\;\;x \cdot \log y - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -3.6000000000000003e69 or 6.00000000000000033e43 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
+-commutative99.7%
associate--r+99.7%
fma-neg99.7%
neg-sub099.7%
associate-+l-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in y around inf 99.8%
Taylor expanded in x around inf 99.8%
add-sqr-sqrt38.6%
pow238.6%
Applied egg-rr38.6%
Taylor expanded in y around 0 89.3%
if -3.6000000000000003e69 < x < 6.00000000000000033e43Initial program 100.0%
Taylor expanded in x around 0 97.2%
Final simplification93.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -290000.0) (not (<= z 340.0))) (- (- z) y) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -290000.0) || !(z <= 340.0)) {
tmp = -z - y;
} else {
tmp = log(t) - 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 <= (-290000.0d0)) .or. (.not. (z <= 340.0d0))) then
tmp = -z - y
else
tmp = log(t) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -290000.0) || !(z <= 340.0)) {
tmp = -z - y;
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -290000.0) or not (z <= 340.0): tmp = -z - y else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -290000.0) || !(z <= 340.0)) tmp = Float64(Float64(-z) - y); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -290000.0) || ~((z <= 340.0))) tmp = -z - y; else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -290000.0], N[Not[LessEqual[z, 340.0]], $MachinePrecision]], N[((-z) - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -290000 \lor \neg \left(z \leq 340\right):\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if z < -2.9e5 or 340 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
+-commutative99.9%
associate--r+99.9%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around inf 99.2%
Taylor expanded in x around 0 77.7%
neg-mul-177.7%
+-commutative77.7%
distribute-neg-in77.7%
sub-neg77.7%
Simplified77.7%
if -2.9e5 < z < 340Initial program 99.8%
Taylor expanded in y around inf 58.6%
neg-mul-158.6%
Simplified58.6%
Taylor expanded in y around 0 58.6%
mul-1-neg58.6%
+-commutative58.6%
sub-neg58.6%
Simplified58.6%
Final simplification68.4%
(FPCore (x y z t) :precision binary64 (if (<= y 0.00039) (- (log t) z) (- (- z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.00039) {
tmp = log(t) - z;
} 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 (y <= 0.00039d0) then
tmp = log(t) - z
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 (y <= 0.00039) {
tmp = Math.log(t) - z;
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 0.00039: tmp = math.log(t) - z else: tmp = -z - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 0.00039) tmp = Float64(log(t) - z); else tmp = Float64(Float64(-z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 0.00039) tmp = log(t) - z; else tmp = -z - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 0.00039], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[((-z) - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.00039:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if y < 3.89999999999999993e-4Initial program 99.8%
Taylor expanded in x around 0 61.1%
Taylor expanded in y around 0 60.8%
if 3.89999999999999993e-4 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
+-commutative99.9%
associate--r+99.9%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around inf 99.5%
Taylor expanded in x around 0 75.6%
neg-mul-175.6%
+-commutative75.6%
distribute-neg-in75.6%
sub-neg75.6%
Simplified75.6%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (- (log t) (+ y z)))
double code(double x, double y, double z, double t) {
return log(t) - (y + z);
}
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(t) - (y + z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) - (y + z);
}
def code(x, y, z, t): return math.log(t) - (y + z)
function code(x, y, z, t) return Float64(log(t) - Float64(y + z)) end
function tmp = code(x, y, z, t) tmp = log(t) - (y + z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t - \left(y + z\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 69.0%
Final simplification69.0%
(FPCore (x y z t) :precision binary64 (if (<= y 1.9e+32) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.9e+32) {
tmp = -z;
} else {
tmp = -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 (y <= 1.9d+32) then
tmp = -z
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.9e+32) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.9e+32: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.9e+32) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.9e+32) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.9e+32], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{+32}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.9000000000000002e32Initial program 99.8%
add-cube-cbrt99.3%
pow399.3%
Applied egg-rr99.3%
Taylor expanded in z around inf 40.7%
neg-mul-140.7%
Simplified40.7%
if 1.9000000000000002e32 < y Initial program 99.9%
Taylor expanded in y around inf 63.1%
neg-mul-163.1%
Simplified63.1%
Taylor expanded in y around inf 63.1%
mul-1-neg63.1%
Simplified63.1%
Final simplification51.0%
(FPCore (x y z t) :precision binary64 (- (- z) y))
double code(double x, double y, double z, double t) {
return -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 = -z - y
end function
public static double code(double x, double y, double z, double t) {
return -z - y;
}
def code(x, y, z, t): return -z - y
function code(x, y, z, t) return Float64(Float64(-z) - y) end
function tmp = code(x, y, z, t) tmp = -z - y; end
code[x_, y_, z_, t_] := N[((-z) - y), $MachinePrecision]
\begin{array}{l}
\\
\left(-z\right) - y
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
+-commutative99.9%
associate--r+99.9%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around inf 88.7%
Taylor expanded in x around 0 58.5%
neg-mul-158.5%
+-commutative58.5%
distribute-neg-in58.5%
sub-neg58.5%
Simplified58.5%
Final simplification58.5%
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
return -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 = -y
end function
public static double code(double x, double y, double z, double t) {
return -y;
}
def code(x, y, z, t): return -y
function code(x, y, z, t) return Float64(-y) end
function tmp = code(x, y, z, t) tmp = -y; end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 99.9%
Taylor expanded in y around inf 41.1%
neg-mul-141.1%
Simplified41.1%
Taylor expanded in y around inf 31.1%
mul-1-neg31.1%
Simplified31.1%
Final simplification31.1%
herbie shell --seed 2023274
(FPCore (x y z t)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (- (* x (log y)) y) z) (log t)))