
(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 (- (- (+ (log t) (* x (log y))) z) y))
double code(double x, double y, double z, double t) {
return ((log(t) + (x * log(y))) - 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) + (x * log(y))) - z) - y
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(t) + (x * Math.log(y))) - z) - y;
}
def code(x, y, z, t): return ((math.log(t) + (x * math.log(y))) - z) - y
function code(x, y, z, t) return Float64(Float64(Float64(log(t) + Float64(x * log(y))) - z) - y) end
function tmp = code(x, y, z, t) tmp = ((log(t) + (x * log(y))) - z) - y; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log t + x \cdot \log y\right) - z\right) - y
\end{array}
Initial program 99.9%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9%
Applied egg-rr99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (<= t_1 -1e+135)
t_1
(if (<= t_1 -2000.0)
(- 0.0 (+ y z))
(if (<= t_1 1e-12) (- (log t) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if (t_1 <= -1e+135) {
tmp = t_1;
} else if (t_1 <= -2000.0) {
tmp = 0.0 - (y + z);
} else if (t_1 <= 1e-12) {
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) :: tmp
t_1 = (x * log(y)) - y
if (t_1 <= (-1d+135)) then
tmp = t_1
else if (t_1 <= (-2000.0d0)) then
tmp = 0.0d0 - (y + z)
else if (t_1 <= 1d-12) 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)) - y;
double tmp;
if (t_1 <= -1e+135) {
tmp = t_1;
} else if (t_1 <= -2000.0) {
tmp = 0.0 - (y + z);
} else if (t_1 <= 1e-12) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if t_1 <= -1e+135: tmp = t_1 elif t_1 <= -2000.0: tmp = 0.0 - (y + z) elif t_1 <= 1e-12: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if (t_1 <= -1e+135) tmp = t_1; elseif (t_1 <= -2000.0) tmp = Float64(0.0 - Float64(y + z)); elseif (t_1 <= 1e-12) 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)) - y; tmp = 0.0; if (t_1 <= -1e+135) tmp = t_1; elseif (t_1 <= -2000.0) tmp = 0.0 - (y + z); elseif (t_1 <= 1e-12) tmp = log(t) - 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] - y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+135], t$95$1, If[LessEqual[t$95$1, -2000.0], N[(0.0 - N[(y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-12], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq -2000:\\
\;\;\;\;0 - \left(y + z\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-12}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -9.99999999999999962e134 or 9.9999999999999998e-13 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6486.7%
Simplified86.7%
if -9.99999999999999962e134 < (-.f64 (*.f64 x (log.f64 y)) y) < -2e3Initial program 99.9%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6479.3%
Simplified79.3%
if -2e3 < (-.f64 (*.f64 x (log.f64 y)) y) < 9.9999999999999998e-13Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
unsub-negN/A
--lowering--.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.9%
Simplified99.9%
Taylor expanded in y around 0
--lowering--.f64N/A
log-lowering-log.f6499.5%
Simplified99.5%
Final simplification87.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y)) (t_3 (- (- t_1 z) y))) (if (<= t_2 -5e+26) t_3 (if (<= t_2 1e-12) (- (- (log t) z) y) t_3))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double t_3 = (t_1 - z) - y;
double tmp;
if (t_2 <= -5e+26) {
tmp = t_3;
} else if (t_2 <= 1e-12) {
tmp = (log(t) - z) - y;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
t_3 = (t_1 - z) - y
if (t_2 <= (-5d+26)) then
tmp = t_3
else if (t_2 <= 1d-12) then
tmp = (log(t) - z) - y
else
tmp = t_3
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 t_3 = (t_1 - z) - y;
double tmp;
if (t_2 <= -5e+26) {
tmp = t_3;
} else if (t_2 <= 1e-12) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y t_3 = (t_1 - z) - y tmp = 0 if t_2 <= -5e+26: tmp = t_3 elif t_2 <= 1e-12: tmp = (math.log(t) - z) - y else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) t_3 = Float64(Float64(t_1 - z) - y) tmp = 0.0 if (t_2 <= -5e+26) tmp = t_3; elseif (t_2 <= 1e-12) tmp = Float64(Float64(log(t) - z) - y); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; t_3 = (t_1 - z) - y; tmp = 0.0; if (t_2 <= -5e+26) tmp = t_3; elseif (t_2 <= 1e-12) tmp = (log(t) - z) - y; else tmp = t_3; 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]}, Block[{t$95$3 = N[(N[(t$95$1 - z), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+26], t$95$3, If[LessEqual[t$95$2, 1e-12], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
t_3 := \left(t\_1 - z\right) - y\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+26}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{-12}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.0000000000000001e26 or 9.9999999999999998e-13 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.4%
Simplified99.4%
if -5.0000000000000001e26 < (-.f64 (*.f64 x (log.f64 y)) y) < 9.9999999999999998e-13Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
unsub-negN/A
--lowering--.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.9%
Simplified99.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 z))) (if (<= (- t_1 y) -2000.0) (- t_2 y) (+ (log t) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - z;
double tmp;
if ((t_1 - y) <= -2000.0) {
tmp = t_2 - y;
} else {
tmp = log(t) + 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)
t_2 = t_1 - z
if ((t_1 - y) <= (-2000.0d0)) then
tmp = t_2 - y
else
tmp = log(t) + 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);
double t_2 = t_1 - z;
double tmp;
if ((t_1 - y) <= -2000.0) {
tmp = t_2 - y;
} else {
tmp = Math.log(t) + t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - z tmp = 0 if (t_1 - y) <= -2000.0: tmp = t_2 - y else: tmp = math.log(t) + t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - z) tmp = 0.0 if (Float64(t_1 - y) <= -2000.0) tmp = Float64(t_2 - y); else tmp = Float64(log(t) + t_2); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - z; tmp = 0.0; if ((t_1 - y) <= -2000.0) tmp = t_2 - y; else tmp = log(t) + t_2; 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 - z), $MachinePrecision]}, If[LessEqual[N[(t$95$1 - y), $MachinePrecision], -2000.0], N[(t$95$2 - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] + t$95$2), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - z\\
\mathbf{if}\;t\_1 - y \leq -2000:\\
\;\;\;\;t\_2 - y\\
\mathbf{else}:\\
\;\;\;\;\log t + t\_2\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2e3Initial program 99.9%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6498.6%
Simplified98.6%
if -2e3 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.6%
Simplified99.6%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (- t_1 z) y)))
(if (<= z -17000000000.0)
t_2
(if (<= z 2.5e-8) (+ (log t) (- t_1 y)) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = (t_1 - z) - y;
double tmp;
if (z <= -17000000000.0) {
tmp = t_2;
} else if (z <= 2.5e-8) {
tmp = log(t) + (t_1 - y);
} 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)
t_2 = (t_1 - z) - y
if (z <= (-17000000000.0d0)) then
tmp = t_2
else if (z <= 2.5d-8) then
tmp = log(t) + (t_1 - y)
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);
double t_2 = (t_1 - z) - y;
double tmp;
if (z <= -17000000000.0) {
tmp = t_2;
} else if (z <= 2.5e-8) {
tmp = Math.log(t) + (t_1 - y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = (t_1 - z) - y tmp = 0 if z <= -17000000000.0: tmp = t_2 elif z <= 2.5e-8: tmp = math.log(t) + (t_1 - y) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(t_1 - z) - y) tmp = 0.0 if (z <= -17000000000.0) tmp = t_2; elseif (z <= 2.5e-8) tmp = Float64(log(t) + Float64(t_1 - y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = (t_1 - z) - y; tmp = 0.0; if (z <= -17000000000.0) tmp = t_2; elseif (z <= 2.5e-8) tmp = log(t) + (t_1 - y); else tmp = t_2; 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[(N[(t$95$1 - z), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[z, -17000000000.0], t$95$2, If[LessEqual[z, 2.5e-8], N[(N[Log[t], $MachinePrecision] + N[(t$95$1 - y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(t\_1 - z\right) - y\\
\mathbf{if}\;z \leq -17000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-8}:\\
\;\;\;\;\log t + \left(t\_1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.7e10 or 2.4999999999999999e-8 < z Initial program 99.9%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.4%
Simplified99.4%
if -1.7e10 < z < 2.4999999999999999e-8Initial program 99.9%
Taylor expanded in z around 0
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.7%
Simplified99.7%
Final simplification99.6%
(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
(let* ((t_1 (* x (log y))) (t_2 (- 0.0 (+ y z))))
(if (<= x -2.3e+124)
t_1
(if (<= x -3.4e-136)
t_2
(if (<= x -1.32e-238) (- (log t) y) (if (<= x 2.7e+38) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = 0.0 - (y + z);
double tmp;
if (x <= -2.3e+124) {
tmp = t_1;
} else if (x <= -3.4e-136) {
tmp = t_2;
} else if (x <= -1.32e-238) {
tmp = log(t) - y;
} else if (x <= 2.7e+38) {
tmp = t_2;
} 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 = 0.0d0 - (y + z)
if (x <= (-2.3d+124)) then
tmp = t_1
else if (x <= (-3.4d-136)) then
tmp = t_2
else if (x <= (-1.32d-238)) then
tmp = log(t) - y
else if (x <= 2.7d+38) then
tmp = t_2
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 = 0.0 - (y + z);
double tmp;
if (x <= -2.3e+124) {
tmp = t_1;
} else if (x <= -3.4e-136) {
tmp = t_2;
} else if (x <= -1.32e-238) {
tmp = Math.log(t) - y;
} else if (x <= 2.7e+38) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = 0.0 - (y + z) tmp = 0 if x <= -2.3e+124: tmp = t_1 elif x <= -3.4e-136: tmp = t_2 elif x <= -1.32e-238: tmp = math.log(t) - y elif x <= 2.7e+38: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(0.0 - Float64(y + z)) tmp = 0.0 if (x <= -2.3e+124) tmp = t_1; elseif (x <= -3.4e-136) tmp = t_2; elseif (x <= -1.32e-238) tmp = Float64(log(t) - y); elseif (x <= 2.7e+38) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = 0.0 - (y + z); tmp = 0.0; if (x <= -2.3e+124) tmp = t_1; elseif (x <= -3.4e-136) tmp = t_2; elseif (x <= -1.32e-238) tmp = log(t) - y; elseif (x <= 2.7e+38) tmp = t_2; 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[(0.0 - N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.3e+124], t$95$1, If[LessEqual[x, -3.4e-136], t$95$2, If[LessEqual[x, -1.32e-238], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 2.7e+38], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := 0 - \left(y + z\right)\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-136}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.32 \cdot 10^{-238}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+38}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.29999999999999985e124 or 2.69999999999999996e38 < x Initial program 99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6471.7%
Simplified71.7%
if -2.29999999999999985e124 < x < -3.4e-136 or -1.31999999999999998e-238 < x < 2.69999999999999996e38Initial program 100.0%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6478.5%
Simplified78.5%
if -3.4e-136 < x < -1.31999999999999998e-238Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
unsub-negN/A
--lowering--.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f64100.0%
Simplified100.0%
Taylor expanded in z around 0
--lowering--.f64N/A
log-lowering-log.f6490.9%
Simplified90.9%
Final simplification77.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* x (log y)) y))) (if (<= x -28.0) t_1 (if (<= x 1.5e+24) (- (- (log t) z) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if (x <= -28.0) {
tmp = t_1;
} else if (x <= 1.5e+24) {
tmp = (log(t) - z) - y;
} 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
if (x <= (-28.0d0)) then
tmp = t_1
else if (x <= 1.5d+24) then
tmp = (log(t) - z) - y
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;
double tmp;
if (x <= -28.0) {
tmp = t_1;
} else if (x <= 1.5e+24) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if x <= -28.0: tmp = t_1 elif x <= 1.5e+24: tmp = (math.log(t) - z) - y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if (x <= -28.0) tmp = t_1; elseif (x <= 1.5e+24) tmp = Float64(Float64(log(t) - z) - y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; tmp = 0.0; if (x <= -28.0) tmp = t_1; elseif (x <= 1.5e+24) tmp = (log(t) - z) - y; 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] - y), $MachinePrecision]}, If[LessEqual[x, -28.0], t$95$1, If[LessEqual[x, 1.5e+24], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;x \leq -28:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+24}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -28 or 1.49999999999999997e24 < x Initial program 99.8%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6483.9%
Simplified83.9%
if -28 < x < 1.49999999999999997e24Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
unsub-negN/A
--lowering--.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f64100.0%
Simplified100.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= x -5.5e+124) t_1 (if (<= x 3.3e+38) (- 0.0 (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -5.5e+124) {
tmp = t_1;
} else if (x <= 3.3e+38) {
tmp = 0.0 - (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 <= (-5.5d+124)) then
tmp = t_1
else if (x <= 3.3d+38) then
tmp = 0.0d0 - (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 <= -5.5e+124) {
tmp = t_1;
} else if (x <= 3.3e+38) {
tmp = 0.0 - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -5.5e+124: tmp = t_1 elif x <= 3.3e+38: tmp = 0.0 - (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 <= -5.5e+124) tmp = t_1; elseif (x <= 3.3e+38) tmp = Float64(0.0 - 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 <= -5.5e+124) tmp = t_1; elseif (x <= 3.3e+38) tmp = 0.0 - (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, -5.5e+124], t$95$1, If[LessEqual[x, 3.3e+38], N[(0.0 - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+38}:\\
\;\;\;\;0 - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.49999999999999977e124 or 3.2999999999999999e38 < x Initial program 99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6471.7%
Simplified71.7%
if -5.49999999999999977e124 < x < 3.2999999999999999e38Initial program 100.0%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6474.3%
Simplified74.3%
Final simplification73.4%
(FPCore (x y z t) :precision binary64 (if (<= y 2.3e-116) (log t) (- 0.0 (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.3e-116) {
tmp = log(t);
} else {
tmp = 0.0 - (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 (y <= 2.3d-116) then
tmp = log(t)
else
tmp = 0.0d0 - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.3e-116) {
tmp = Math.log(t);
} else {
tmp = 0.0 - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.3e-116: tmp = math.log(t) else: tmp = 0.0 - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.3e-116) tmp = log(t); else tmp = Float64(0.0 - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.3e-116) tmp = log(t); else tmp = 0.0 - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.3e-116], N[Log[t], $MachinePrecision], N[(0.0 - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-116}:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;0 - \left(y + z\right)\\
\end{array}
\end{array}
if y < 2.30000000000000002e-116Initial program 99.8%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
unsub-negN/A
--lowering--.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6463.7%
Simplified63.7%
Taylor expanded in z around 0
--lowering--.f64N/A
log-lowering-log.f6437.9%
Simplified37.9%
Taylor expanded in y around 0
log-lowering-log.f6437.9%
Simplified37.9%
if 2.30000000000000002e-116 < y Initial program 99.9%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6469.3%
Simplified69.3%
Final simplification60.5%
(FPCore (x y z t) :precision binary64 (if (<= z -460000000000.0) (- 0.0 z) (if (<= z 1.9e+117) (- 0.0 y) (- 0.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -460000000000.0) {
tmp = 0.0 - z;
} else if (z <= 1.9e+117) {
tmp = 0.0 - y;
} else {
tmp = 0.0 - 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 (z <= (-460000000000.0d0)) then
tmp = 0.0d0 - z
else if (z <= 1.9d+117) then
tmp = 0.0d0 - y
else
tmp = 0.0d0 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -460000000000.0) {
tmp = 0.0 - z;
} else if (z <= 1.9e+117) {
tmp = 0.0 - y;
} else {
tmp = 0.0 - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -460000000000.0: tmp = 0.0 - z elif z <= 1.9e+117: tmp = 0.0 - y else: tmp = 0.0 - z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -460000000000.0) tmp = Float64(0.0 - z); elseif (z <= 1.9e+117) tmp = Float64(0.0 - y); else tmp = Float64(0.0 - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -460000000000.0) tmp = 0.0 - z; elseif (z <= 1.9e+117) tmp = 0.0 - y; else tmp = 0.0 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -460000000000.0], N[(0.0 - z), $MachinePrecision], If[LessEqual[z, 1.9e+117], N[(0.0 - y), $MachinePrecision], N[(0.0 - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -460000000000:\\
\;\;\;\;0 - z\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+117}:\\
\;\;\;\;0 - y\\
\mathbf{else}:\\
\;\;\;\;0 - z\\
\end{array}
\end{array}
if z < -4.6e11 or 1.9000000000000001e117 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6460.8%
Simplified60.8%
sub0-negN/A
neg-lowering-neg.f6460.8%
Applied egg-rr60.8%
if -4.6e11 < z < 1.9000000000000001e117Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6444.0%
Simplified44.0%
sub0-negN/A
neg-lowering-neg.f6444.0%
Applied egg-rr44.0%
Final simplification50.2%
(FPCore (x y z t) :precision binary64 (- 0.0 (+ y z)))
double code(double x, double y, double z, double t) {
return 0.0 - (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 = 0.0d0 - (y + z)
end function
public static double code(double x, double y, double z, double t) {
return 0.0 - (y + z);
}
def code(x, y, z, t): return 0.0 - (y + z)
function code(x, y, z, t) return Float64(0.0 - Float64(y + z)) end
function tmp = code(x, y, z, t) tmp = 0.0 - (y + z); end
code[x_, y_, z_, t_] := N[(0.0 - N[(y + z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0 - \left(y + z\right)
\end{array}
Initial program 99.9%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6457.7%
Simplified57.7%
Final simplification57.7%
(FPCore (x y z t) :precision binary64 (- 0.0 y))
double code(double x, double y, double z, double t) {
return 0.0 - 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 = 0.0d0 - y
end function
public static double code(double x, double y, double z, double t) {
return 0.0 - y;
}
def code(x, y, z, t): return 0.0 - y
function code(x, y, z, t) return Float64(0.0 - y) end
function tmp = code(x, y, z, t) tmp = 0.0 - y; end
code[x_, y_, z_, t_] := N[(0.0 - y), $MachinePrecision]
\begin{array}{l}
\\
0 - y
\end{array}
Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6434.1%
Simplified34.1%
sub0-negN/A
neg-lowering-neg.f6434.1%
Applied egg-rr34.1%
Final simplification34.1%
herbie shell --seed 2024161
(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)))