
(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 13 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 x (log y) (log t)) y) z))
double code(double x, double y, double z, double t) {
return (fma(x, log(y), log(t)) - y) - z;
}
function code(x, y, z, t) return Float64(Float64(fma(x, log(y), log(t)) - y) - z) end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(x, \log y, \log t\right) - y\right) - z
\end{array}
Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (- (* x (log y)) y) z))) (if (<= t_1 -4e+19) t_1 (if (<= t_1 5e+17) (fma x (log y) (log t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((x * log(y)) - y) - z;
double tmp;
if (t_1 <= -4e+19) {
tmp = t_1;
} else if (t_1 <= 5e+17) {
tmp = fma(x, log(y), log(t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x * log(y)) - y) - z) tmp = 0.0 if (t_1 <= -4e+19) tmp = t_1; elseif (t_1 <= 5e+17) tmp = fma(x, log(y), log(t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+19], t$95$1, If[LessEqual[t$95$1, 5e+17], N[(x * N[Log[y], $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \log y - y\right) - z\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+17}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -4e19 or 5e17 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6499.9
Applied rewrites99.9%
if -4e19 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 5e17Initial program 99.9%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f6498.6
Applied rewrites98.6%
Taylor expanded in z around 0
Applied rewrites98.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (- (* x (log y)) y) z))) (if (<= t_1 -50000.0) t_1 (if (<= t_1 1e-5) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((x * log(y)) - y) - z;
double tmp;
if (t_1 <= -50000.0) {
tmp = t_1;
} else if (t_1 <= 1e-5) {
tmp = log(t) - (y + z);
} else {
tmp = t_1;
}
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) - z
if (t_1 <= (-50000.0d0)) then
tmp = t_1
else if (t_1 <= 1d-5) then
tmp = log(t) - (y + z)
else
tmp = t_1
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) - z;
double tmp;
if (t_1 <= -50000.0) {
tmp = t_1;
} else if (t_1 <= 1e-5) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x * math.log(y)) - y) - z tmp = 0 if t_1 <= -50000.0: tmp = t_1 elif t_1 <= 1e-5: tmp = math.log(t) - (y + z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x * log(y)) - y) - z) tmp = 0.0 if (t_1 <= -50000.0) tmp = t_1; elseif (t_1 <= 1e-5) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x * log(y)) - y) - z; tmp = 0.0; if (t_1 <= -50000.0) tmp = t_1; elseif (t_1 <= 1e-5) tmp = log(t) - (y + z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[t$95$1, -50000.0], t$95$1, If[LessEqual[t$95$1, 1e-5], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \log y - y\right) - z\\
\mathbf{if}\;t\_1 \leq -50000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{-5}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -5e4 or 1.00000000000000008e-5 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6499.4
Applied rewrites99.4%
if -5e4 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6498.6
Applied rewrites98.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y))) (if (<= t_2 -2e+16) (- (- y) z) (if (<= t_2 6e+15) (- (log t) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+16) {
tmp = -y - z;
} else if (t_2 <= 6e+15) {
tmp = log(t) - z;
} else {
tmp = t_1;
}
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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-2d+16)) then
tmp = -y - z
else if (t_2 <= 6d+15) then
tmp = log(t) - z
else
tmp = t_1
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 t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+16) {
tmp = -y - z;
} else if (t_2 <= 6e+15) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -2e+16: tmp = -y - z elif t_2 <= 6e+15: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -2e+16) tmp = Float64(Float64(-y) - z); elseif (t_2 <= 6e+15) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -2e+16) tmp = -y - z; elseif (t_2 <= 6e+15) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+16], N[((-y) - z), $MachinePrecision], If[LessEqual[t$95$2, 6e+15], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+16}:\\
\;\;\;\;\left(-y\right) - z\\
\mathbf{elif}\;t\_2 \leq 6 \cdot 10^{+15}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2e16Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6473.1
Applied rewrites73.1%
if -2e16 < (-.f64 (*.f64 x (log.f64 y)) y) < 6e15Initial program 100.0%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f6499.1
Applied rewrites99.1%
Taylor expanded in x around 0
Applied rewrites96.9%
if 6e15 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6473.5
Applied rewrites73.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (- (* x (log y)) y) z)))
(if (<= z -4.5e+31)
t_1
(if (<= z 220.0) (fma x (log y) (- (log t) y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((x * log(y)) - y) - z;
double tmp;
if (z <= -4.5e+31) {
tmp = t_1;
} else if (z <= 220.0) {
tmp = fma(x, log(y), (log(t) - y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x * log(y)) - y) - z) tmp = 0.0 if (z <= -4.5e+31) tmp = t_1; elseif (z <= 220.0) tmp = fma(x, log(y), Float64(log(t) - y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[z, -4.5e+31], t$95$1, If[LessEqual[z, 220.0], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \log y - y\right) - z\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 220:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.4999999999999996e31 or 220 < z Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6499.9
Applied rewrites99.9%
if -4.4999999999999996e31 < z < 220Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f64N/A
lower-log.f6499.5
Applied rewrites99.5%
(FPCore (x y z t) :precision binary64 (if (<= (- (* x (log y)) y) -2e+16) (- (- y) z) (- (log t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * log(y)) - y) <= -2e+16) {
tmp = -y - z;
} else {
tmp = log(t) - 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 * log(y)) - y) <= (-2d+16)) then
tmp = -y - z
else
tmp = log(t) - z
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) <= -2e+16) {
tmp = -y - z;
} else {
tmp = Math.log(t) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * math.log(y)) - y) <= -2e+16: tmp = -y - z else: tmp = math.log(t) - z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * log(y)) - y) <= -2e+16) tmp = Float64(Float64(-y) - z); else tmp = Float64(log(t) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * log(y)) - y) <= -2e+16) tmp = -y - z; else tmp = log(t) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], -2e+16], N[((-y) - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot \log y - y \leq -2 \cdot 10^{+16}:\\
\;\;\;\;\left(-y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2e16Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6473.1
Applied rewrites73.1%
if -2e16 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f6498.8
Applied rewrites98.8%
Taylor expanded in x around 0
Applied rewrites72.2%
(FPCore (x y z t) :precision binary64 (if (<= y 2e-5) (fma x (log y) (- (log t) z)) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2e-5) {
tmp = fma(x, log(y), (log(t) - z));
} else {
tmp = ((x * log(y)) - y) - z;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 2e-5) tmp = fma(x, log(y), Float64(log(t) - z)); else tmp = Float64(Float64(Float64(x * log(y)) - y) - z); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 2e-5], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \log y - y\right) - z\\
\end{array}
\end{array}
if y < 2.00000000000000016e-5Initial program 99.8%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f6499.3
Applied rewrites99.3%
if 2.00000000000000016e-5 < y Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6499.9
Applied rewrites99.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* x (log y)) z))) (if (<= x -1.8e+93) t_1 (if (<= x 1.8e+65) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - z;
double tmp;
if (x <= -1.8e+93) {
tmp = t_1;
} else if (x <= 1.8e+65) {
tmp = log(t) - (y + z);
} else {
tmp = t_1;
}
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)) - z
if (x <= (-1.8d+93)) then
tmp = t_1
else if (x <= 1.8d+65) then
tmp = log(t) - (y + z)
else
tmp = t_1
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)) - z;
double tmp;
if (x <= -1.8e+93) {
tmp = t_1;
} else if (x <= 1.8e+65) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - z tmp = 0 if x <= -1.8e+93: tmp = t_1 elif x <= 1.8e+65: tmp = math.log(t) - (y + z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - z) tmp = 0.0 if (x <= -1.8e+93) tmp = t_1; elseif (x <= 1.8e+65) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - z; tmp = 0.0; if (x <= -1.8e+93) tmp = t_1; elseif (x <= 1.8e+65) tmp = log(t) - (y + z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -1.8e+93], t$95$1, If[LessEqual[x, 1.8e+65], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - z\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+65}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.8e93 or 1.79999999999999989e65 < x Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6484.5
Applied rewrites84.5%
if -1.8e93 < x < 1.79999999999999989e65Initial program 100.0%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6494.3
Applied rewrites94.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= x -2.1e+200) t_1 (if (<= x 1e+155) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -2.1e+200) {
tmp = t_1;
} else if (x <= 1e+155) {
tmp = log(t) - (y + z);
} else {
tmp = t_1;
}
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 (x <= (-2.1d+200)) then
tmp = t_1
else if (x <= 1d+155) then
tmp = log(t) - (y + z)
else
tmp = t_1
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 (x <= -2.1e+200) {
tmp = t_1;
} else if (x <= 1e+155) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -2.1e+200: tmp = t_1 elif x <= 1e+155: tmp = math.log(t) - (y + z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2.1e+200) tmp = t_1; elseif (x <= 1e+155) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -2.1e+200) tmp = t_1; elseif (x <= 1e+155) tmp = log(t) - (y + z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+200], t$95$1, If[LessEqual[x, 1e+155], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+200}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 10^{+155}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.09999999999999997e200 or 1.00000000000000001e155 < x Initial program 99.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6480.1
Applied rewrites80.1%
if -2.09999999999999997e200 < x < 1.00000000000000001e155Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6486.8
Applied rewrites86.8%
(FPCore (x y z t) :precision binary64 (if (<= y 3.5e+19) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.5e+19) {
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 <= 3.5d+19) 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 <= 3.5e+19) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.5e+19: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.5e+19) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.5e+19) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.5e+19], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{+19}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 3.5e19Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6439.6
Applied rewrites39.6%
if 3.5e19 < y Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6461.3
Applied rewrites61.3%
(FPCore (x y z t) :precision binary64 (- (- y) z))
double code(double x, double y, double z, double t) {
return -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 = -y - z
end function
public static double code(double x, double y, double z, double t) {
return -y - z;
}
def code(x, y, z, t): return -y - z
function code(x, y, z, t) return Float64(Float64(-y) - z) end
function tmp = code(x, y, z, t) tmp = -y - z; end
code[x_, y_, z_, t_] := N[((-y) - z), $MachinePrecision]
\begin{array}{l}
\\
\left(-y\right) - z
\end{array}
Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6456.9
Applied rewrites56.9%
(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
mul-1-negN/A
lower-neg.f6430.5
Applied rewrites30.5%
(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 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%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6428.7
Applied rewrites28.7%
Applied rewrites4.1%
Applied rewrites2.4%
herbie shell --seed 2024221
(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)))