
(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 12 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)) (t_2 (- t_1 z))) (if (<= t_1 -2e+16) t_2 (if (<= t_1 2e-27) (- (log t) (+ y z)) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double t_2 = t_1 - z;
double tmp;
if (t_1 <= -2e+16) {
tmp = t_2;
} else if (t_1 <= 2e-27) {
tmp = log(t) - (y + z);
} else {
tmp = t_2;
}
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)) - y
t_2 = t_1 - z
if (t_1 <= (-2d+16)) then
tmp = t_2
else if (t_1 <= 2d-27) then
tmp = log(t) - (y + z)
else
tmp = t_2
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 t_2 = t_1 - z;
double tmp;
if (t_1 <= -2e+16) {
tmp = t_2;
} else if (t_1 <= 2e-27) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y t_2 = t_1 - z tmp = 0 if t_1 <= -2e+16: tmp = t_2 elif t_1 <= 2e-27: tmp = math.log(t) - (y + z) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) t_2 = Float64(t_1 - z) tmp = 0.0 if (t_1 <= -2e+16) tmp = t_2; elseif (t_1 <= 2e-27) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; t_2 = t_1 - z; tmp = 0.0; if (t_1 <= -2e+16) tmp = t_2; elseif (t_1 <= 2e-27) tmp = log(t) - (y + z); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - z), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+16], t$95$2, If[LessEqual[t$95$1, 2e-27], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
t_2 := t\_1 - z\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-27}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2e16 or 2.0000000000000001e-27 < (-.f64 (*.f64 x (log.f64 y)) 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.5
Applied rewrites99.5%
if -2e16 < (-.f64 (*.f64 x (log.f64 y)) y) < 2.0000000000000001e-27Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6497.5
Applied rewrites97.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (- (* x (log y)) y) z)) (t_2 (- (- y) z))) (if (<= t_1 -2e+16) t_2 (if (<= t_1 10000000.0) (log t) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = ((x * log(y)) - y) - z;
double t_2 = -y - z;
double tmp;
if (t_1 <= -2e+16) {
tmp = t_2;
} else if (t_1 <= 10000000.0) {
tmp = log(t);
} else {
tmp = t_2;
}
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)) - y) - z
t_2 = -y - z
if (t_1 <= (-2d+16)) then
tmp = t_2
else if (t_1 <= 10000000.0d0) then
tmp = log(t)
else
tmp = t_2
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 t_2 = -y - z;
double tmp;
if (t_1 <= -2e+16) {
tmp = t_2;
} else if (t_1 <= 10000000.0) {
tmp = Math.log(t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x * math.log(y)) - y) - z t_2 = -y - z tmp = 0 if t_1 <= -2e+16: tmp = t_2 elif t_1 <= 10000000.0: tmp = math.log(t) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x * log(y)) - y) - z) t_2 = Float64(Float64(-y) - z) tmp = 0.0 if (t_1 <= -2e+16) tmp = t_2; elseif (t_1 <= 10000000.0) tmp = log(t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x * log(y)) - y) - z; t_2 = -y - z; tmp = 0.0; if (t_1 <= -2e+16) tmp = t_2; elseif (t_1 <= 10000000.0) tmp = log(t); else tmp = t_2; 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]}, Block[{t$95$2 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+16], t$95$2, If[LessEqual[t$95$1, 10000000.0], N[Log[t], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \log y - y\right) - z\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10000000:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -2e16 or 1e7 < (-.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 y around inf
mul-1-negN/A
lower-neg.f6462.2
Applied rewrites62.2%
if -2e16 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 1e7Initial 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.f6497.2
Applied rewrites97.2%
Taylor expanded in x around 0
Applied rewrites90.9%
Taylor expanded in z around 0
Applied rewrites89.1%
(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 5e+33) (- (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 <= 5e+33) {
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 <= 5d+33) 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 <= 5e+33) {
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 <= 5e+33: 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 <= 5e+33) 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 <= 5e+33) 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, 5e+33], 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 5 \cdot 10^{+33}:\\
\;\;\;\;\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.f6469.2
Applied rewrites69.2%
if -2e16 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.99999999999999973e33Initial 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.4
Applied rewrites98.4%
Taylor expanded in x around 0
Applied rewrites94.9%
if 4.99999999999999973e33 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6480.8
Applied rewrites80.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (- (* x (log y)) y) z)))
(if (<= z -410.0)
t_1
(if (<= z 1.9e-26) (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 <= -410.0) {
tmp = t_1;
} else if (z <= 1.9e-26) {
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 <= -410.0) tmp = t_1; elseif (z <= 1.9e-26) 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, -410.0], t$95$1, If[LessEqual[z, 1.9e-26], 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 -410:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-26}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -410 or 1.90000000000000007e-26 < 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.4
Applied rewrites99.4%
if -410 < z < 1.90000000000000007e-26Initial 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.3
Applied rewrites99.3%
(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.f6469.2
Applied rewrites69.2%
if -2e16 < (-.f64 (*.f64 x (log.f64 y)) y) Initial 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.2
Applied rewrites98.2%
Taylor expanded in x around 0
Applied rewrites63.8%
(FPCore (x y z t) :precision binary64 (if (<= y 0.00016) (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 <= 0.00016) {
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 <= 0.00016) 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, 0.00016], 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 0.00016:\\
\;\;\;\;\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 < 1.60000000000000013e-4Initial 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.1
Applied rewrites99.1%
if 1.60000000000000013e-4 < 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.8
Applied rewrites99.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* x (log y)) z))) (if (<= x -4.5e+34) t_1 (if (<= x 2.6e+31) (- (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 <= -4.5e+34) {
tmp = t_1;
} else if (x <= 2.6e+31) {
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 <= (-4.5d+34)) then
tmp = t_1
else if (x <= 2.6d+31) 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 <= -4.5e+34) {
tmp = t_1;
} else if (x <= 2.6e+31) {
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 <= -4.5e+34: tmp = t_1 elif x <= 2.6e+31: 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 <= -4.5e+34) tmp = t_1; elseif (x <= 2.6e+31) 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 <= -4.5e+34) tmp = t_1; elseif (x <= 2.6e+31) 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, -4.5e+34], t$95$1, If[LessEqual[x, 2.6e+31], 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 -4.5 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+31}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.5e34 or 2.6e31 < x 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.f6479.8
Applied rewrites79.8%
if -4.5e34 < x < 2.6e31Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6497.6
Applied rewrites97.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= x -1.25e+90) t_1 (if (<= x 8.5e+39) (- (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 <= -1.25e+90) {
tmp = t_1;
} else if (x <= 8.5e+39) {
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 <= (-1.25d+90)) then
tmp = t_1
else if (x <= 8.5d+39) 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 <= -1.25e+90) {
tmp = t_1;
} else if (x <= 8.5e+39) {
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 <= -1.25e+90: tmp = t_1 elif x <= 8.5e+39: 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 <= -1.25e+90) tmp = t_1; elseif (x <= 8.5e+39) 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 <= -1.25e+90) tmp = t_1; elseif (x <= 8.5e+39) 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, -1.25e+90], t$95$1, If[LessEqual[x, 8.5e+39], 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 -1.25 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+39}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.2500000000000001e90 or 8.49999999999999971e39 < x Initial program 99.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6471.1
Applied rewrites71.1%
if -1.2500000000000001e90 < x < 8.49999999999999971e39Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6493.2
Applied rewrites93.2%
(FPCore (x y z t) :precision binary64 (if (<= (- (* x (log y)) y) -5e+98) (- y) (- z)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * log(y)) - y) <= -5e+98) {
tmp = -y;
} else {
tmp = -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) <= (-5d+98)) then
tmp = -y
else
tmp = -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) <= -5e+98) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * math.log(y)) - y) <= -5e+98: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * log(y)) - y) <= -5e+98) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * log(y)) - y) <= -5e+98) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], -5e+98], (-y), (-z)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot \log y - y \leq -5 \cdot 10^{+98}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -4.9999999999999998e98Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6457.3
Applied rewrites57.3%
if -4.9999999999999998e98 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6437.2
Applied rewrites37.2%
(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.f6453.6
Applied rewrites53.6%
(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.2
Applied rewrites30.2%
herbie shell --seed 2024219
(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)))