
(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 10 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 (fma (log y) x (- (- (log t) y) z)))
double code(double x, double y, double z, double t) {
return fma(log(y), x, ((log(t) - y) - z));
}
function code(x, y, z, t) return fma(log(y), x, Float64(Float64(log(t) - y) - z)) end
code[x_, y_, z_, t_] := N[(N[Log[y], $MachinePrecision] * x + N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log y, x, \left(\log t - y\right) - z\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-rgt-identityN/A
*-inversesN/A
fp-cancel-sign-subN/A
mul-1-negN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
remove-double-negN/A
fp-cancel-sign-subN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (<= t_1 -1e+29)
(- (log t) y)
(if (<= t_1 1e+68) (- (log t) z) (* (log y) x)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if (t_1 <= -1e+29) {
tmp = log(t) - y;
} else if (t_1 <= 1e+68) {
tmp = log(t) - z;
} else {
tmp = log(y) * 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) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - y
if (t_1 <= (-1d+29)) then
tmp = log(t) - y
else if (t_1 <= 1d+68) then
tmp = log(t) - z
else
tmp = log(y) * x
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)) - y;
double tmp;
if (t_1 <= -1e+29) {
tmp = Math.log(t) - y;
} else if (t_1 <= 1e+68) {
tmp = Math.log(t) - z;
} else {
tmp = Math.log(y) * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if t_1 <= -1e+29: tmp = math.log(t) - y elif t_1 <= 1e+68: tmp = math.log(t) - z else: tmp = math.log(y) * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if (t_1 <= -1e+29) tmp = Float64(log(t) - y); elseif (t_1 <= 1e+68) tmp = Float64(log(t) - z); else tmp = Float64(log(y) * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; tmp = 0.0; if (t_1 <= -1e+29) tmp = log(t) - y; elseif (t_1 <= 1e+68) tmp = log(t) - z; else tmp = log(y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+29], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[t$95$1, 1e+68], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+29}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;t\_1 \leq 10^{+68}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot x\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -9.99999999999999914e28Initial program 99.9%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6481.8
Applied rewrites81.8%
Taylor expanded in x around 0
Applied rewrites59.1%
if -9.99999999999999914e28 < (-.f64 (*.f64 x (log.f64 y)) y) < 9.99999999999999953e67Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-rgt-identityN/A
*-inversesN/A
fp-cancel-sign-subN/A
mul-1-negN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
remove-double-negN/A
fp-cancel-sign-subN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.9%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f64N/A
lower-log.f6496.2
Applied rewrites96.2%
Taylor expanded in x around 0
Applied rewrites89.6%
if 9.99999999999999953e67 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-rgt-identityN/A
*-inversesN/A
fp-cancel-sign-subN/A
mul-1-negN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
remove-double-negN/A
fp-cancel-sign-subN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6482.7
Applied rewrites82.7%
(FPCore (x y z t) :precision binary64 (if (<= (- (* x (log y)) y) 1e+68) (- (- (log t) y) z) (fma (log y) x (log t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * log(y)) - y) <= 1e+68) {
tmp = (log(t) - y) - z;
} else {
tmp = fma(log(y), x, log(t));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * log(y)) - y) <= 1e+68) tmp = Float64(Float64(log(t) - y) - z); else tmp = fma(log(y), x, log(t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], 1e+68], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot \log y - y \leq 10^{+68}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < 9.99999999999999953e67Initial program 99.9%
Taylor expanded in x around 0
associate--r+N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-log.f6483.0
Applied rewrites83.0%
if 9.99999999999999953e67 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-rgt-identityN/A
*-inversesN/A
fp-cancel-sign-subN/A
mul-1-negN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
remove-double-negN/A
fp-cancel-sign-subN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f64N/A
lower-log.f6497.6
Applied rewrites97.6%
Taylor expanded in z around 0
Applied rewrites82.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (log t) y))) (if (or (<= z -8.8e+60) (not (<= z 4e+59))) (- t_1 z) (fma (log y) x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double tmp;
if ((z <= -8.8e+60) || !(z <= 4e+59)) {
tmp = t_1 - z;
} else {
tmp = fma(log(y), x, t_1);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(t) - y) tmp = 0.0 if ((z <= -8.8e+60) || !(z <= 4e+59)) tmp = Float64(t_1 - z); else tmp = fma(log(y), x, t_1); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[Or[LessEqual[z, -8.8e+60], N[Not[LessEqual[z, 4e+59]], $MachinePrecision]], N[(t$95$1 - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+60} \lor \neg \left(z \leq 4 \cdot 10^{+59}\right):\\
\;\;\;\;t\_1 - z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, t\_1\right)\\
\end{array}
\end{array}
if z < -8.79999999999999984e60 or 3.99999999999999989e59 < z Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-log.f6489.4
Applied rewrites89.4%
if -8.79999999999999984e60 < z < 3.99999999999999989e59Initial program 99.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6496.4
Applied rewrites96.4%
Applied rewrites96.4%
Final simplification93.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8.8e+60) (not (<= z 4e+59))) (- (- (log t) y) z) (- (fma (log y) x (log t)) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.8e+60) || !(z <= 4e+59)) {
tmp = (log(t) - y) - z;
} else {
tmp = fma(log(y), x, log(t)) - y;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((z <= -8.8e+60) || !(z <= 4e+59)) tmp = Float64(Float64(log(t) - y) - z); else tmp = Float64(fma(log(y), x, log(t)) - y); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8.8e+60], N[Not[LessEqual[z, 4e+59]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+60} \lor \neg \left(z \leq 4 \cdot 10^{+59}\right):\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\
\end{array}
\end{array}
if z < -8.79999999999999984e60 or 3.99999999999999989e59 < z Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-log.f6489.4
Applied rewrites89.4%
if -8.79999999999999984e60 < z < 3.99999999999999989e59Initial program 99.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6496.4
Applied rewrites96.4%
Final simplification93.9%
(FPCore (x y z t) :precision binary64 (if (<= (- (* x (log y)) y) 1e+68) (- (- (log t) y) z) (* (log y) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * log(y)) - y) <= 1e+68) {
tmp = (log(t) - y) - z;
} else {
tmp = log(y) * 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 (((x * log(y)) - y) <= 1d+68) then
tmp = (log(t) - y) - z
else
tmp = log(y) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x * Math.log(y)) - y) <= 1e+68) {
tmp = (Math.log(t) - y) - z;
} else {
tmp = Math.log(y) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * math.log(y)) - y) <= 1e+68: tmp = (math.log(t) - y) - z else: tmp = math.log(y) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * log(y)) - y) <= 1e+68) tmp = Float64(Float64(log(t) - y) - z); else tmp = Float64(log(y) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * log(y)) - y) <= 1e+68) tmp = (log(t) - y) - z; else tmp = log(y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], 1e+68], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot \log y - y \leq 10^{+68}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot x\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < 9.99999999999999953e67Initial program 99.9%
Taylor expanded in x around 0
associate--r+N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-log.f6483.0
Applied rewrites83.0%
if 9.99999999999999953e67 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-rgt-identityN/A
*-inversesN/A
fp-cancel-sign-subN/A
mul-1-negN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
remove-double-negN/A
fp-cancel-sign-subN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6482.7
Applied rewrites82.7%
(FPCore (x y z t) :precision binary64 (if (<= y 9.5e+28) (- (log t) z) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.5e+28) {
tmp = log(t) - z;
} 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 (y <= 9.5d+28) then
tmp = log(t) - z
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 (y <= 9.5e+28) {
tmp = Math.log(t) - z;
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 9.5e+28: tmp = math.log(t) - z else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 9.5e+28) tmp = Float64(log(t) - z); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 9.5e+28) tmp = log(t) - z; else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 9.5e+28], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{+28}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if y < 9.49999999999999927e28Initial program 99.8%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-rgt-identityN/A
*-inversesN/A
fp-cancel-sign-subN/A
mul-1-negN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
remove-double-negN/A
fp-cancel-sign-subN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f64N/A
lower-log.f6497.4
Applied rewrites97.4%
Taylor expanded in x around 0
Applied rewrites65.3%
if 9.49999999999999927e28 < y Initial program 100.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6482.5
Applied rewrites82.5%
Taylor expanded in x around 0
Applied rewrites62.1%
(FPCore (x y z t) :precision binary64 (if (<= y 9.5e+28) (- (log t) z) (* -1.0 y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.5e+28) {
tmp = log(t) - z;
} else {
tmp = -1.0 * 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 <= 9.5d+28) then
tmp = log(t) - z
else
tmp = (-1.0d0) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.5e+28) {
tmp = Math.log(t) - z;
} else {
tmp = -1.0 * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 9.5e+28: tmp = math.log(t) - z else: tmp = -1.0 * y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 9.5e+28) tmp = Float64(log(t) - z); else tmp = Float64(-1.0 * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 9.5e+28) tmp = log(t) - z; else tmp = -1.0 * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 9.5e+28], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[(-1.0 * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{+28}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot y\\
\end{array}
\end{array}
if y < 9.49999999999999927e28Initial program 99.8%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-rgt-identityN/A
*-inversesN/A
fp-cancel-sign-subN/A
mul-1-negN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
remove-double-negN/A
fp-cancel-sign-subN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f64N/A
lower-log.f6497.4
Applied rewrites97.4%
Taylor expanded in x around 0
Applied rewrites65.3%
if 9.49999999999999927e28 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Taylor expanded in y around inf
Applied rewrites62.1%
(FPCore (x y z t) :precision binary64 (if (<= y 65000000000000.0) (- z) (* -1.0 y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 65000000000000.0) {
tmp = -z;
} else {
tmp = -1.0 * 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 <= 65000000000000.0d0) then
tmp = -z
else
tmp = (-1.0d0) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 65000000000000.0) {
tmp = -z;
} else {
tmp = -1.0 * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 65000000000000.0: tmp = -z else: tmp = -1.0 * y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 65000000000000.0) tmp = Float64(-z); else tmp = Float64(-1.0 * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 65000000000000.0) tmp = -z; else tmp = -1.0 * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 65000000000000.0], (-z), N[(-1.0 * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 65000000000000:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot y\\
\end{array}
\end{array}
if y < 6.5e13Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6435.6
Applied rewrites35.6%
if 6.5e13 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Taylor expanded in y around inf
Applied rewrites60.6%
(FPCore (x y z t) :precision binary64 (- z))
double code(double x, double y, double z, double t) {
return -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 = -z
end function
public static double code(double x, double y, double z, double t) {
return -z;
}
def code(x, y, z, t): return -z
function code(x, y, z, t) return Float64(-z) end
function tmp = code(x, y, z, t) tmp = -z; end
code[x_, y_, z_, t_] := (-z)
\begin{array}{l}
\\
-z
\end{array}
Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6427.1
Applied rewrites27.1%
herbie shell --seed 2024339
(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)))